Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set last_reset for integrated entities in IoTaWatt #65143

Merged
merged 3 commits into from
Feb 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update homeassistant/components/iotawatt/sensor.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
  • Loading branch information
agners and frenck authored Jan 28, 2022
commit 23fc7f332ac7cdd0ff6339d4f265ce80a94ae865
2 changes: 1 addition & 1 deletion homeassistant/components/iotawatt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def extra_state_attributes(self) -> dict[str, str]:
attrs = {"type": data.getType()}
if attrs["type"] == "Input":
attrs["channel"] = data.getChannel()
if data.getBegin() and (last_reset := dt.parse_datetime(data.getBegin())):
if (begin := data.getBegin()) and (last_reset := dt.parse_datetime(begin)):
attrs[ATTR_LAST_RESET] = last_reset.isoformat()
agners marked this conversation as resolved.
Show resolved Hide resolved

return attrs
Expand Down