Skip to content

Commit 1ddb39f

Browse files
rytilahtiepenet
andauthored
Use TEMPERATURE_DELTA for tplink temperature offset (home-assistant#155239)
Co-authored-by: epenet <[email protected]>
1 parent 10d2e38 commit 1ddb39f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

homeassistant/components/tplink/number.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from homeassistant.components.number import (
1212
DOMAIN as NUMBER_DOMAIN,
13+
NumberDeviceClass,
1314
NumberEntity,
1415
NumberEntityDescription,
1516
NumberMode,
@@ -56,6 +57,7 @@ class TPLinkNumberEntityDescription(
5657
TPLinkNumberEntityDescription(
5758
key="temperature_offset",
5859
mode=NumberMode.BOX,
60+
device_class=NumberDeviceClass.TEMPERATURE_DELTA,
5961
),
6062
TPLinkNumberEntityDescription(
6163
key="pan_step",

tests/components/tplink/snapshots/test_number.ambr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
'name': None,
348348
'options': dict({
349349
}),
350-
'original_device_class': None,
350+
'original_device_class': <NumberDeviceClass.TEMPERATURE_DELTA: 'temperature_delta'>,
351351
'original_icon': None,
352352
'original_name': 'Temperature offset',
353353
'platform': 'tplink',
@@ -362,6 +362,7 @@
362362
# name: test_states[number.my_device_temperature_offset-state]
363363
StateSnapshot({
364364
'attributes': ReadOnlyDict({
365+
'device_class': 'temperature_delta',
365366
'friendly_name': 'my_device Temperature offset',
366367
'max': 10,
367368
'min': -10,

0 commit comments

Comments
 (0)