diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ packages.append('spaceapi.schema') setup( name='c3l_spaceapi', - version='0.0.4', + version='0.0.5', url=None, license='GPLv3+', author='Dennis Fink', diff --git a/spaceapi/utils.py b/spaceapi/utils.py --- a/spaceapi/utils.py +++ b/spaceapi/utils.py @@ -55,9 +55,9 @@ class ActiveStatus(Singleton, dict): def add_user_present(self, username): if self['state']['open']: if 'people_now_present' not in self['sensors']: - self['sensors']['people_now_present'] = {'value': 0} + self['sensors']['people_now_present'] = [{'value': 0}] - people_now_present = self['sensors']['people_now_present'] + people_now_present = self['sensors']['people_now_present'][0] if 'names' in people_now_present and username not in people_now_present['names']: people_now_present['value'] += 1 @@ -71,13 +71,13 @@ class ActiveStatus(Singleton, dict): if username in current_app.config['PEOPLE_NOW_PRESENT_ALLOWED']: people_now_present['names'] = [username] - self['sensors']['people_now_present'] = people_now_present + self['sensors']['people_now_present'][0] = people_now_present else: pass def remove_user_present(self, username): if self['state']['open'] and 'people_now_present' in self['sensors']: - people_now_present = self['sensors']['people_now_present'] + people_now_present = self['sensors']['people_now_present'][0] if people_now_present['value'] > 0: people_now_present['value'] -= 1 @@ -89,7 +89,7 @@ class ActiveStatus(Singleton, dict): people_now_present['names'].remove(username) if not people_now_present['names']: del people_now_present['names'] - self['sensors']['people_now_present'] = people_now_present + self['sensors']['people_now_present'][0] = people_now_present else: pass