projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More type annotations.
[python_utils.git]
/
smart_home
/
outlets.py
diff --git
a/smart_home/outlets.py
b/smart_home/outlets.py
index 8fd09487a48b5c49478bb5d84b91d481dc36adfc..c079cfd09d9cbbfbb8595379770ebc1c8d7497ae 100644
(file)
--- a/
smart_home/outlets.py
+++ b/
smart_home/outlets.py
@@
-48,14
+48,16
@@
def tplink_outlet_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))
+ msg = f'{command} died with signal {signal}'
+ logger.warning(msg)
+ logging_utils.hlog(msg)
return False
else:
exit_value = result >> 8
if exit_value != 0:
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))
+ msg = f'{command} failed, exited {exit_value}'
+ logger.warning(msg)
+ logging_utils.hlog(msg)
return False
logger.debug(f'{command} succeeded.')
return True
return False
logger.debug(f'{command} succeeded.')
return True