From 582d8382cc2185283d1822c17a3986d05166c55b Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 20 Nov 2023 00:51:55 +0100 Subject: [PATCH] fix sensors path --- me.s3lph.spaceapi/spaceapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/me.s3lph.spaceapi/spaceapi.py b/me.s3lph.spaceapi/spaceapi.py index d46327d..1da1524 100644 --- a/me.s3lph.spaceapi/spaceapi.py +++ b/me.s3lph.spaceapi/spaceapi.py @@ -97,8 +97,8 @@ class SpaceapiBot(Plugin): try: fmt = { 'lastchange': datetime.fromtimestamp(state['state']['lastchange']).strftime('%H:%M'), - 'known_users': state.get('state', {}).get('sensors', {}).get('people_now_present', [{}])[0].get('names', ""), - 'user_cnt': state.get('state', {}).get('sensors', {}).get('people_now_present', [{}])[0].get('value', 0) + 'known_users': state.get('sensors', {}).get('people_now_present', [{}])[0].get('names', ""), + 'user_cnt': state.get('sensors', {}).get('people_now_present', [{}])[0].get('value', 0) } if state['state']['open']: body = self.config['messages']['open'].format(**fmt)