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

Added extra check for token init



git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2209 b32b6428-25c9-4566-ad07-03861ab6144f
parent 9830379c
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,9 @@ class Gateway(AqaraDev):
logger.warning(e)
def write(self,data = {}):
if self.token == None:
logger.warning("No token yet, please wait")
return
key = self.make_key()
data.update({"key":key})
pload = {"cmd":"write",
......@@ -236,12 +239,13 @@ class Gateway(AqaraDev):
eng.add_timer(self._lamp_blink,1,15)
## Siren go here
def siren_play(self,_sound=26,_volume=5):
def siren_play(self,_sound=2,_volume=5):
logger.info('Playing %s %s' % (_sound,_volume))
data = {
"mid" : _sound,
"volume": _volume,
"mid" : int(_sound),
"volume": int(_volume),
}
self.write(data)
print(self.write(data))
def siren_stop(self):
data = { "mid" : 999 }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment