From 556deb4f777d47df46f66fd8c3bb4a44204c942c Mon Sep 17 00:00:00 2001 From: "Steven B." <51370195+sdb9696@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:03:51 +0100 Subject: [PATCH] Fix tplink number platform to use intended BOX mode (#126397) The NumberMode should be BOX as per the entity description but due to the missing dataclass decorator was resolving to NumberMode.AUTO. --- homeassistant/components/tplink/number.py | 2 ++ .../components/tplink/snapshots/test_number.ambr | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/tplink/number.py b/homeassistant/components/tplink/number.py index 4b273800e6a..999d01b2814 100644 --- a/homeassistant/components/tplink/number.py +++ b/homeassistant/components/tplink/number.py @@ -2,6 +2,7 @@ from __future__ import annotations +from dataclasses import dataclass import logging from typing import Final @@ -26,6 +27,7 @@ from .entity import ( _LOGGER = logging.getLogger(__name__) +@dataclass(frozen=True, kw_only=True) class TPLinkNumberEntityDescription( NumberEntityDescription, TPLinkFeatureEntityDescription ): diff --git a/tests/components/tplink/snapshots/test_number.ambr b/tests/components/tplink/snapshots/test_number.ambr index ee06314ffe3..977d2098fb9 100644 --- a/tests/components/tplink/snapshots/test_number.ambr +++ b/tests/components/tplink/snapshots/test_number.ambr @@ -43,7 +43,7 @@ 'capabilities': dict({ 'max': 65536, 'min': 0, - 'mode': , + 'mode': , 'step': 1.0, }), 'config_entry_id': , @@ -79,7 +79,7 @@ 'friendly_name': 'my_device Smooth off', 'max': 65536, 'min': 0, - 'mode': , + 'mode': , 'step': 1.0, }), 'context': , @@ -98,7 +98,7 @@ 'capabilities': dict({ 'max': 65536, 'min': 0, - 'mode': , + 'mode': , 'step': 1.0, }), 'config_entry_id': , @@ -134,7 +134,7 @@ 'friendly_name': 'my_device Smooth on', 'max': 65536, 'min': 0, - 'mode': , + 'mode': , 'step': 1.0, }), 'context': , @@ -153,7 +153,7 @@ 'capabilities': dict({ 'max': 65536, 'min': -10, - 'mode': , + 'mode': , 'step': 1.0, }), 'config_entry_id': , @@ -189,7 +189,7 @@ 'friendly_name': 'my_device Temperature offset', 'max': 65536, 'min': -10, - 'mode': , + 'mode': , 'step': 1.0, }), 'context': , @@ -208,7 +208,7 @@ 'capabilities': dict({ 'max': 65536, 'min': 0, - 'mode': , + 'mode': , 'step': 1.0, }), 'config_entry_id': , @@ -244,7 +244,7 @@ 'friendly_name': 'my_device Turn off in', 'max': 65536, 'min': 0, - 'mode': , + 'mode': , 'step': 1.0, }), 'context': ,