Ver Fonte

code review changes

JC Connell há 1 ano atrás
pai
commit
15ac106e35

+ 3 - 5
custom_components/tuya_local/devices/gosund_SW2_dimmer_switch.yaml

@@ -1,4 +1,4 @@
-name: Gosund SW2 Dimmer Switch
+name: Dimmer switch
 products:
   - id: qcgkaqmaivuwfwz4
     manufacturer: Gosund
@@ -16,13 +16,11 @@ entities:
           min: 25
           max: 255
   - entity: binary_sensor
-    name: Temperature Alarm
-    class: problem
+    name: Temperature alarm
+    class: heat
     category: diagnostic
-    icon: "mdi:thermometer-alert"
     dps:
       - id: 101
         type: boolean
         name: sensor
-        readonly: true
         optional: true

+ 0 - 6
tests/const.py

@@ -683,12 +683,6 @@ ARLEC_FAN_LIGHT_PAYLOAD = {
     "103": "off",
 }
 
-GOSUND_DUMMER_SWITCH_PAYLOAD = {
-    "1": True,
-    "3": 23,
-    "101": False,
-}
-
 CARSON_CB_PAYLOAD = {
     "1": True,
     "2": 20,

+ 0 - 46
tests/devices/test_gosund_SW2_dimmer_switch.py

@@ -1,46 +0,0 @@
-"""Tests for the switch entity."""
-
-from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.switch import SwitchDeviceClass
-
-from ..const import GOSUND_DUMMER_SWITCH_PAYLOAD
-from ..mixins.binary_sensor import BasicBinarySensorTests
-from ..mixins.switch import SwitchableTests
-from .base_device_tests import TuyaDeviceTestCase
-
-SWITCH_DPS = "1"
-BRIGHTNESS_DPS = "3"
-TEMPERATURE_DPS = "101"
-
-
-class TestGosundSwitch(
-    BasicBinarySensorTests,
-    SwitchableTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig("gosund_SW2_dimmer_switch.yaml", GOSUND_DUMMER_SWITCH_PAYLOAD)
-        self.subject = self.entities.get("light")
-        self.setUpSwitchable(SWITCH_DPS, self.subject)
-        self.setUpBasicBinarySensor(
-            TEMPERATURE_DPS,
-            self.entities.get("binary_sensor_temperature_alarm"),
-            device_class=BinarySensorDeviceClass.PROBLEM,
-        )
-
-        self.mark_secondary(["binary_sensor_temperature_alarm"])
-
-    def test_device_class_is_light(self):
-        self.assertEqual(self.subject.device_class, SwitchDeviceClass.LIGHT)
-
-    def test_switch_is_on(self):
-        self.dps[SWITCH_DPS] = False
-        self.assertFalse(self.light.is_on)
-        self.dps[SWITCH_DPS] = True
-        self.assertTrue(self.light.is_on)
-
-    def test_light_brightness(self):
-        self.dps[BRIGHTNESS_DPS] = 50
-        self.assertAlmostEqual(self.light.brightness, 129, 0)