Changeset - 319b08c756e5
[Not reviewed]
default
0 1 0
Dennis Fink - 9 years ago 2016-03-17 23:54:27
dennis.fink@c3l.lu
Some state adjustments
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
spaceapi/utils.py
Show inline comments
 
@@ -56,18 +56,22 @@ class ActiveStatus(Singleton, dict):
 
        if self['state']['open']:
 
            if 'people_now_present' not in self['sensors']:
 
                self['sensors']['people_now_present'] = {'value': 0}
 

	
 
            people_now_present = self['sensors']['people_now_present']
 

	
 
            if 'names' in people_now_present and username not in people_now_present['names']:
 
            people_now_present['value'] += 1
 

	
 
            if username in current_app.config['PEOPLE_NOW_PRESENT_ALLOWED']:
 
                if 'names' in people_now_present and username not in people_now_present['names']:
 
                    people_now_present['names'].append(username)
 
                else:
 

	
 
            elif 'names' not in people_now_present:
 
                people_now_present['value'] += 1
 

	
 
                if username in current_app.config['PEOPLE_NOW_PRESENT_ALLOWED']:
 
                    people_now_present['names'] = [username]
 

	
 
            self['sensors']['people_now_present'] = people_now_present
 
        else:
 
            pass
 

	
0 comments (0 inline, 0 general)