If a plug reports no consumption at all, the script will report "Not Supplied":
Plug: slow-cooker using 0.0W, today: Not Supplied
This is because we do this:
if today_usage:
print(f"Plug: {kasa['name']} using {now_usage_w}W, today: {today_usage/1000} kWh")
else:
print(f"Plug: {kasa['name']} using {now_usage_w}W, today: Not Supplied")
0 is equivalent to False. Need to update those checks to something like
if today_usage !== False
It doesn't have any impact on the data written to Influx (the field is simply omitted), only the CLI output
Activity
22-Dec-23 10:57
assigned to @btasker
22-Dec-23 10:57
mentioned in issue #7
23-Dec-23 10:27
Fixed in commit 81339f18010036505393456215ea17b59ed79eb0
04-Aug-24 09:25
mentioned in commit github-mirror/tplink_to_influxdb@81339f18010036505393456215ea17b59ed79eb0
Message
fix: don't report "not supplied" if today_usage = 0 (utilities/tp-link-to-influxdb#8)