Skip to content
Snippets Groups Projects
Commit 28bc1140 authored by jkerdreu's avatar jkerdreu
Browse files

Added Powerrelay


git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2021 b32b6428-25c9-4566-ad07-03861ab6144f
parent 2f5ec620
Branches
No related tags found
No related merge requests found
......@@ -22,14 +22,18 @@ def handler(event,dev):
def display(dev):
type_ = str(dev.devtype)
attr = dev.attributes
if type_.startswith('thermometer'):
if type_.startswith('thermometer.'):
return '%s°' % attr.get('temperature','--')
if type_.startswith('hygrometer'):
if type_.startswith('hygrometer.'):
return '%s%%' % attr.get('humidity','--')
if type_.startswith('lamp'):
if type_.startswith('lamp.'):
val = attr.get('light',None)
if val:return 'ON'
return 'OFF'
if type_.startswith('powerrelay.'):
val = attr.get('power',None)
if val:return 'ON'
return 'OFF'
return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment