Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
0b7b4152
Unverified
Commit
0b7b4152
authored
3 years ago
by
Erik Montnemery
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove last_reset attribute from devolo energy sensors (#54803)
parent
d9bfb8fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/devolo_home_control/sensor.py
+3
-10
3 additions, 10 deletions
homeassistant/components/devolo_home_control/sensor.py
with
3 additions
and
10 deletions
homeassistant/components/devolo_home_control/sensor.py
+
3
−
10
View file @
0b7b4152
...
...
@@ -12,7 +12,7 @@ from homeassistant.components.sensor import (
DEVICE_CLASS_POWER
,
DEVICE_CLASS_TEMPERATURE
,
DEVICE_CLASS_VOLTAGE
,
STATE_CLASS_
MEASUREMENT
,
STATE_CLASS_
TOTAL_INCREASING
,
SensorEntity
,
)
from
homeassistant.config_entries
import
ConfigEntry
...
...
@@ -162,10 +162,7 @@ class DevoloConsumptionEntity(DevoloMultiLevelDeviceEntity):
)
if
consumption
==
"
total
"
:
self
.
_attr_state_class
=
STATE_CLASS_MEASUREMENT
self
.
_attr_last_reset
=
device_instance
.
consumption_property
[
element_uid
].
total_since
self
.
_attr_state_class
=
STATE_CLASS_TOTAL_INCREASING
self
.
_value
=
getattr
(
device_instance
.
consumption_property
[
element_uid
],
consumption
...
...
@@ -180,15 +177,11 @@ class DevoloConsumptionEntity(DevoloMultiLevelDeviceEntity):
def
_sync
(
self
,
message
:
tuple
)
->
None
:
"""
Update the consumption sensor state.
"""
if
message
[
0
]
==
self
.
_attr_unique_id
and
message
[
2
]
!=
"
total_since
"
:
if
message
[
0
]
==
self
.
_attr_unique_id
:
self
.
_value
=
getattr
(
self
.
_device_instance
.
consumption_property
[
self
.
_attr_unique_id
],
self
.
_sensor_type
,
)
elif
message
[
0
]
==
self
.
_attr_unique_id
and
message
[
2
]
==
"
total_since
"
:
self
.
_attr_last_reset
=
self
.
_device_instance
.
consumption_property
[
self
.
_attr_unique_id
].
total_since
else
:
self
.
_generic_message
(
message
)
self
.
schedule_update_ha_state
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment