Skip to content

Commit ae2d7f4

Browse files
committed
CR: Include unitofmeasure
1 parent 70f6689 commit ae2d7f4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

custom_components/plugwise_usb/number.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
NumberEntity,
1414
NumberEntityDescription,
1515
)
16-
from homeassistant.const import EntityCategory, Platform, UnitOfTime
16+
from homeassistant.const import (
17+
PERCENTAGE,
18+
EntityCategory,
19+
Platform,
20+
UnitOfTemperature,
21+
UnitOfTime,
22+
)
1723
from homeassistant.core import HomeAssistant, callback
1824
from homeassistant.helpers.entity_platform import AddEntitiesCallback
1925

@@ -101,6 +107,7 @@ class PlugwiseNumberEntityDescription(
101107
node_feature=NodeFeature.SENSE_HYSTERESIS,
102108
entity_category=EntityCategory.CONFIG,
103109
device_class=NumberDeviceClass.HUMIDITY,
110+
native_unit_of_measurement=PERCENTAGE,
104111
native_max_value=99,
105112
native_min_value=1,
106113
native_step=0.1,
@@ -114,6 +121,7 @@ class PlugwiseNumberEntityDescription(
114121
node_feature=NodeFeature.SENSE_HYSTERESIS,
115122
entity_category=EntityCategory.CONFIG,
116123
device_class=NumberDeviceClass.HUMIDITY,
124+
native_unit_of_measurement=PERCENTAGE,
117125
native_max_value=99,
118126
native_min_value=1,
119127
native_step=0.1,
@@ -127,6 +135,7 @@ class PlugwiseNumberEntityDescription(
127135
node_feature=NodeFeature.SENSE_HYSTERESIS,
128136
entity_category=EntityCategory.CONFIG,
129137
device_class=NumberDeviceClass.TEMPERATURE,
138+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
130139
native_max_value=60,
131140
native_min_value=1,
132141
native_step=0.1,
@@ -140,6 +149,7 @@ class PlugwiseNumberEntityDescription(
140149
node_feature=NodeFeature.SENSE_HYSTERESIS,
141150
entity_category=EntityCategory.CONFIG,
142151
device_class=NumberDeviceClass.TEMPERATURE,
152+
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
143153
native_max_value=60,
144154
native_min_value=1,
145155
native_step=0.1,

0 commit comments

Comments
 (0)