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

Nothing important

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2017 b32b6428-25c9-4566-ad07-03861ab6144f
parent ea579269
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,6 @@ class NWS(object): # NWS: netatmo weather station
class NWSM(NWS): # NWSM: netatmo weather station module
def __init__(self,module_addr,module_group):
NWS.__init__(self,module_addr,module_group)
pass
def init_module(self,sensors_type_list):
self.new_sensors(sensors_type_list)
......@@ -87,85 +86,3 @@ class NWSM(NWS): # NWSM: netatmo weather station module
def update_module(self,attr_value_dic):
self.update_sensors(attr_value_dic)
"""
# test
def main():
try:
mainIndoor=NWSM('5d3cdc97-48b0-11e8-aaf2-e0db55fb413b','5d3cdc97-48b0-11e8-aaf2-e0db55fb413a')
print(str(mainIndoor))
s=["thermometer","hygrometer","barometer","co2meter","soundmeter","wifimeter"]
mainIndoor.init_module(s)
d={"temperature":10,
"humidity":20,
"pressure":30,
"co2":40,
"sound":50,
"wifi_status":100}
mainIndoor.update_module(d)
print(mainIndoor.sensors)
additionIndoor=NWSM('5d3cdc97-48b0-11e8-aaf2-e0db55fb413b','5d3cdc97-48b0-11e8-aaf2-e0db55fb413a')
print(str(additionIndoor))
s=["thermometer","hygrometer","co2meter","radiometer","batterymeter"]
additionIndoor.init_module(s)
d={"temperature":10,
"humidity":20,
"co2":40,
"radio_status":56,
"battery_level":100}
additionIndoor.update_module(d)
print(additionIndoor.sensors)
outdoor=NWSM('5d3cdc97-48b0-11e8-aaf2-e0db55fb413b','5d3cdc97-48b0-11e8-aaf2-e0db55fb413a')
print(str(outdoor))
s=["thermometer","hygrometer","radiometer","batterymeter"]
outdoor.init_module(s)
d={"temperature":10,
"humidity":20,
"radio_status":56,
"battery_level":100}
outdoor.update_module(d)
print(outdoor.sensors)
rainGouge=NWSM('5d3cdc97-48b0-11e8-aaf2-e0db55fb413b','5d3cdc97-48b0-11e8-aaf2-e0db55fb413a')
print(str(rainGouge))
s=["rainmeter","radiometer","batterymeter"]
rainGouge.init_module(s)
d={"rain":10,
"radio_status":56,
"battery_level":100}
rainGouge.update_module(d)
print(rainGouge.sensors)
windGouge=NWSM('5d3cdc97-48b0-11e8-aaf2-e0db55fb413b','5d3cdc97-48b0-11e8-aaf2-e0db55fb413a')
print(str(windGouge))
s=["windmeter","radiometer","batterymeter"]
windGouge.init_module(s)
d={"windstrength":10,
"windangle":20,
"guststrength":30,
"gustangle":40,
"radio_status":56,
"battery_level":100}
windGouge.update_module(d)
print(windGouge.sensors)
except KeyboardInterrupt:
print("Bye Bye..")
if __name__ == '__main__':
main()
"""
......@@ -12,7 +12,7 @@ class NWSC: # netatmo weather station config
if ('gateway' not in self.configfile)or('base_addr' not in self.configfile['gateway'])or(not tools.is_valid_addr(self.configfile['gateway']["base_addr"])):
self.configfile['gateway']={}
self.configfile['gateway']['base_addr']=tools.get_random_uuid()
self.configfile['gateway']['base_addr']=tools.get_random_uuid()[:-2]+'00'
if 'devices' not in self.configfile:
self.configfile['devices']={}
......@@ -27,7 +27,7 @@ class NWSC: # netatmo weather station config
if modules[i][0] not in self.configfile['devices'] :
self.configfile['devices'][modules[i][0]]={}
self.configfile['devices'][modules[i][0]]['group_addr'] =tools.get_random_uuid()
self.configfile['devices'][modules[i][0]]['base_addr']=tools.get_random_uuid()
self.configfile['devices'][modules[i][0]]['base_addr'] =tools.get_random_uuid()[:-2] + '00'
self.configfile['devices'][modules[i][0]]['type'] =modules[i][1]
self.configfile['devices'][modules[i][0]].inline_comments['type']=self.__get_comments(modules[i][1])
......@@ -71,19 +71,6 @@ class NWSC: # netatmo weather station config
else:
return 'invalid netatmo type !!!'
"""
# test
FILE_NAME="xaal.netatmo"
PACKAGE_NAME = "xaal.netatmo"
def main():
configfile = tools.load_cfg_or_die(PACKAGE_NAME)
config=NWSC(configfile)
config.update_configfile()
if __name__ == '__main__':
main()
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment