Changes between Version 30 and Version 31 of Proposal


Ignore:
Timestamp:
Jun 5, 2013, 1:15:23 PM (11 years ago)
Author:
Frédéric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Proposal

    v30 v31  
    2323{{{
    2424#!python
    25 from pknyx.api import Device, ETS
     25from pknyx.api import Device, Stack, ETS
     26
     27stack = Stack()
     28ets = ETS(stack)
    2629
    2730# Weather station class definition
     
    4043
    4144# Registering device
    42 ETS.register(station)
     45ets.register(station)
    4346
    4447# Linking weather station Datapoints to Group Address
    45 ETS.link(dev=station, dp="temperature", gad="1/1/1")
    46 ETS.link(dev=station, dp="humidity", gad="1/1/2")
    47 ETS.link(dev=station, dp="wind_speed", gad="1/1/3")
    48 ETS.link(dev=station, dp="wind_alarm", gad="1/1/4")
    49 ETS.link(dev=station, dp="wind_speed_limit", gad="1/1/5")
    50 ETS.link(dev=station, dp="wind_alarm_enable", gad="1/1/6")
     48ets.link(dev=station, dp="temperature", gad="1/1/1")
     49ets.link(dev=station, dp="humidity", gad="1/1/2")
     50ets.link(dev=station, dp="wind_speed", gad="1/1/3")
     51ets.link(dev=station, dp="wind_alarm", gad="1/1/4")
     52ets.link(dev=station, dp="wind_speed_limit", gad="1/1/5")
     53ets.link(dev=station, dp="wind_alarm_enable", gad="1/1/6")
    5154}}}
    5255
     
    5962{{{
    6063#!python
    61 from pknyx.api import Device, ETS
     64from pknyx.api import Device, Stack, ETS
     65
     66stack = Stack()
     67ets = ETS(stack)
    6268
    6369# Weather station class definition
     
    9298
    9399# Registering device
    94 ETS.register(station)
     100ets.register(station)
    95101
    96102# Linking weather station Datapoints to Group Address
    97 ETS.link(dev=station, dp="temperature", gad="1/1/1")
    98 ETS.link(dev=station, dp="humidity", gad="1/1/2")
    99 ETS.link(dev=station, dp="wind_speed", gad="1/1/3")
    100 ETS.link(dev=station, dp="wind_alarm", gad="1/1/4")
    101 ETS.link(dev=station, dp="wind_speed_limit", gad="1/1/5")
    102 ETS.link(dev=station, dp="wind_alarm_enable", gad="1/1/6")
     103ets.link(dev=station, dp="temperature", gad="1/1/1")
     104ets.link(dev=station, dp="humidity", gad="1/1/2")
     105ets.link(dev=station, dp="wind_speed", gad="1/1/3")
     106ets.link(dev=station, dp="wind_alarm", gad="1/1/4")
     107ets.link(dev=station, dp="wind_speed_limit", gad="1/1/5")
     108ets.link(dev=station, dp="wind_alarm_enable", gad="1/1/6")
    103109}}}
    104110
     
    134140{{{
    135141#!python
    136 from pknyx.api import Rule, ETS
     142from pknyx.api import Rule, Stack, ETS
     143
     144stack = Stack()
     145ets = ETS(stack)
    137146
    138147class BathroomHeater(Rule):
     
    151160
    152161heater = BathroomHeater(name="bathroom_heater", desc="Bathroom heating management", address="1.2.3")
    153 ETS.register(heaterRule)
    154 ETS.link(rule=heater, dp="bathroom_temp", gad="1/1/1")
    155 ETS.link(rule=heater, dp="bathroom_temp_setup", gad="1/1/2")
    156 ETS.link(rule=heater, dp="bathroom_heater", gad="1/1/3")
     162ets.register(heaterRule)
     163ets.link(rule=heater, dp="bathroom_temp", gad="1/1/1")
     164ets.link(rule=heater, dp="bathroom_temp_setup", gad="1/1/2")
     165ets.link(rule=heater, dp="bathroom_heater", gad="1/1/3")
    157166}}}
    158167