projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugfixes.
[python_utils.git]
/
light_utils.py
diff --git
a/light_utils.py
b/light_utils.py
index bd73ee3dfa9fa3d352116e7dd88171284610f65c..8101a32523c486d0bc2ff782be8435297c18bcd9 100644
(file)
--- a/
light_utils.py
+++ b/
light_utils.py
@@
-48,13
+48,16
@@
def tplink_light_command(command: str) -> bool:
result = os.system(command)
signal = result & 0xFF
if signal != 0:
result = os.system(command)
signal = result & 0xFF
if signal != 0:
+ logger.warning(f'{command} died with signal {signal}')
logging_utils.hlog("%s died with signal %d" % (command, signal))
return False
else:
exit_value = result >> 8
if exit_value != 0:
logging_utils.hlog("%s died with signal %d" % (command, signal))
return False
else:
exit_value = result >> 8
if exit_value != 0:
+ logger.warning(f'{command} failed, exited {exit_value}')
logging_utils.hlog("%s failed, exit %d" % (command, exit_value))
return False
logging_utils.hlog("%s failed, exit %d" % (command, exit_value))
return False
+ logger.debug(f'{command} succeeded.')
return True
return True
@@
-212,6
+215,7
@@
class TPLinkLight(Light):
cmd = self.get_cmdline(child) + f"-c {cmd}"
if extra_args is not None:
cmd += f" {extra_args}"
cmd = self.get_cmdline(child) + f"-c {cmd}"
if extra_args is not None:
cmd += f" {extra_args}"
+ logger.debug(f'About to execute {cmd}')
return tplink_light_command(cmd)
def turn_on(self, child: str = None) -> bool:
return tplink_light_command(cmd)
def turn_on(self, child: str = None) -> bool: