diff --git a/miio/discovery.py b/miio/discovery.py index eb23cea50..3fd7ed43c 100644 --- a/miio/discovery.py +++ b/miio/discovery.py @@ -17,6 +17,7 @@ "chuangmi-plug-m1": Plug, "chuangmi-plug-v2": Plug, "chuangmi-plug-v1": PlugV1, + "chuangmi-plug_": PlugV1, "qmi-powerstrip-v1": PowerStrip, "zimi-powerstrip-v2": PowerStrip, "zhimi-airpurifier-m1": AirPurifier, diff --git a/miio/plug_v1.py b/miio/plug_v1.py index c3ead53ad..c81620a6c 100644 --- a/miio/plug_v1.py +++ b/miio/plug_v1.py @@ -24,10 +24,15 @@ def is_on(self) -> bool: def usb_power(self) -> bool: return self.data["usb_on"] + @property + def temperature(self) -> float: + return self.data["temperature"] + def __str__(self) -> str: - s = "" % \ + s = "" % \ (self.power, - self.usb_power) + self.usb_power, + self.temperature) return s @@ -36,7 +41,7 @@ class PlugV1(Device): def status(self) -> PlugV1Status: """Retrieve properties.""" - properties = ['on', 'usb_on'] + properties = ['on', 'usb_on', 'temperature'] values = self.send( "get_prop", properties