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
1beab969
Unverified
Commit
1beab969
authored
2 years ago
by
rappenze
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Replace deprecated unit constants in fibaro sensor (#81425)
parent
bda7e416
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/fibaro/sensor.py
+8
-9
8 additions, 9 deletions
homeassistant/components/fibaro/sensor.py
with
8 additions
and
9 deletions
homeassistant/components/fibaro/sensor.py
+
8
−
9
View file @
1beab969
...
...
@@ -14,13 +14,12 @@ from homeassistant.components.sensor import (
from
homeassistant.config_entries
import
ConfigEntry
from
homeassistant.const
import
(
CONCENTRATION_PARTS_PER_MILLION
,
ENERGY_KILO_WATT_HOUR
,
LIGHT_LUX
,
PERCENTAGE
,
POWER_WATT
,
TEMP_CELSIUS
,
TEMP_FAHRENHEIT
,
Platform
,
UnitOfEnergy
,
UnitOfPower
,
UnitOfTemperature
,
)
from
homeassistant.core
import
HomeAssistant
from
homeassistant.helpers.entity_platform
import
AddEntitiesCallback
...
...
@@ -67,7 +66,7 @@ MAIN_SENSOR_TYPES: dict[str, SensorEntityDescription] = {
"
com.fibaro.energyMeter
"
:
SensorEntityDescription
(
key
=
"
com.fibaro.energyMeter
"
,
name
=
"
Energy
"
,
native_unit_of_measurement
=
ENERGY_
KILO_WATT_HOUR
,
native_unit_of_measurement
=
UnitOfEnergy
.
KILO_WATT_HOUR
,
device_class
=
SensorDeviceClass
.
ENERGY
,
state_class
=
SensorStateClass
.
TOTAL_INCREASING
,
),
...
...
@@ -79,14 +78,14 @@ ADDITIONAL_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription
(
key
=
"
energy
"
,
name
=
"
Energy
"
,
native_unit_of_measurement
=
ENERGY_
KILO_WATT_HOUR
,
native_unit_of_measurement
=
UnitOfEnergy
.
KILO_WATT_HOUR
,
device_class
=
SensorDeviceClass
.
ENERGY
,
state_class
=
SensorStateClass
.
TOTAL_INCREASING
,
),
SensorEntityDescription
(
key
=
"
power
"
,
name
=
"
Power
"
,
native_unit_of_measurement
=
POWER_
WATT
,
native_unit_of_measurement
=
UnitOfPower
.
WATT
,
device_class
=
SensorDeviceClass
.
POWER
,
state_class
=
SensorStateClass
.
MEASUREMENT
,
),
...
...
@@ -94,8 +93,8 @@ ADDITIONAL_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
FIBARO_TO_HASS_UNIT
:
dict
[
str
,
str
]
=
{
"
lux
"
:
LIGHT_LUX
,
"
C
"
:
TEMP_
CELSIUS
,
"
F
"
:
TEMP_
FAHRENHEIT
,
"
C
"
:
UnitOfTemperature
.
CELSIUS
,
"
F
"
:
UnitOfTemperature
.
FAHRENHEIT
,
}
...
...
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