From 4ad1107c61c237534a2bea8ddd2da99d9993235f Mon Sep 17 00:00:00 2001 From: Dinculescu Date: Mon, 20 May 2024 11:17:56 +0100 Subject: [PATCH] Remove overheated from DeviceInfoGenericResult Addresses #216. --- CHANGELOG.md | 8 ++++++++ .../responses/device_info_result/color_light_result.pyi | 8 ++++---- .../tapo/responses/device_info_result/generic_result.pyi | 1 - .../tapo/responses/device_info_result/hub_result.pyi | 4 ++-- .../tapo/responses/device_info_result/light_result.pyi | 2 +- .../tapo/responses/device_info_result/plug_result.pyi | 2 +- tapo/src/responses/device_info_result/color_light.rs | 8 ++++---- tapo/src/responses/device_info_result/generic.rs | 1 - tapo/src/responses/device_info_result/hub.rs | 4 ++-- tapo/src/responses/device_info_result/light.rs | 2 +- tapo/src/responses/device_info_result/plug.rs | 2 +- tapo/src/responses/device_info_result/rgb_light_strip.rs | 8 ++++---- .../src/responses/device_info_result/rgbic_light_strip.rs | 8 ++++---- 13 files changed, 32 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dc254a..bebc44f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,20 @@ file. This change log follows the conventions of - `PlugIdentifier` has been renamed to `Plug`. - `Plug::ByDeviceId` now verifies that the provided device ID is found and returns an `Error::DeviceNotFound` error when it's not. +### Removed + +- The `overheated` property has been removed from `DeviceInfoGenericResult` because it's not present in the response of all devices. + ## [Python Unreleased][Unreleased] ### Fixed - All handlers are now correctly exported and can be imported from the `tapo` module. +### Removed + +- The `overheated` property has been removed from `DeviceInfoGenericResult` because it's not present in the response of all devices. + ## [Rust v0.7.11][v0.7.11] - 2024-05-04 ### Added diff --git a/tapo-py/tapo-py/tapo/responses/device_info_result/color_light_result.pyi b/tapo-py/tapo-py/tapo/responses/device_info_result/color_light_result.pyi index 4954d74..278877a 100644 --- a/tapo-py/tapo-py/tapo/responses/device_info_result/color_light_result.pyi +++ b/tapo-py/tapo-py/tapo/responses/device_info_result/color_light_result.pyi @@ -23,7 +23,6 @@ class DeviceInfoColorLightResult: device_on: bool on_time: int """The time in seconds this device has been ON since the last state change (ON/OFF).""" - overheated: bool nickname: str avatar: str has_set_location_info: bool @@ -34,13 +33,14 @@ class DeviceInfoColorLightResult: # Unique to this device brightness: int + color_temp: int + default_states: DefaultColorLightState + """The default state of a device to be used when internet connectivity is lost after a power cut.""" dynamic_light_effect_enable: bool dynamic_light_effect_id: Optional[str] hue: Optional[int] + overheated: bool saturation: Optional[int] - color_temp: int - default_states: DefaultColorLightState - """The default state of a device to be used when internet connectivity is lost after a power cut.""" def to_dict(self) -> dict: """Gets all the properties of this result as a dictionary. diff --git a/tapo-py/tapo-py/tapo/responses/device_info_result/generic_result.pyi b/tapo-py/tapo-py/tapo/responses/device_info_result/generic_result.pyi index 6fe19f3..7a57da4 100644 --- a/tapo-py/tapo-py/tapo/responses/device_info_result/generic_result.pyi +++ b/tapo-py/tapo-py/tapo/responses/device_info_result/generic_result.pyi @@ -21,7 +21,6 @@ class DeviceInfoGenericResult: device_on: Optional[bool] on_time: Optional[int] """The time in seconds this device has been ON since the last state change (ON/OFF).""" - overheated: bool nickname: str avatar: str has_set_location_info: bool diff --git a/tapo-py/tapo-py/tapo/responses/device_info_result/hub_result.pyi b/tapo-py/tapo-py/tapo/responses/device_info_result/hub_result.pyi index f992fa5..27e5a9b 100644 --- a/tapo-py/tapo-py/tapo/responses/device_info_result/hub_result.pyi +++ b/tapo-py/tapo-py/tapo/responses/device_info_result/hub_result.pyi @@ -18,7 +18,6 @@ class DeviceInfoHubResult: rssi: int specs: str lang: str - overheated: bool nickname: str avatar: str has_set_location_info: bool @@ -28,8 +27,9 @@ class DeviceInfoHubResult: time_diff: Optional[int] # Unique to this device - in_alarm: bool in_alarm_source: str + in_alarm: bool + overheated: bool def to_dict(self) -> dict: """Gets all the properties of this result as a dictionary. diff --git a/tapo-py/tapo-py/tapo/responses/device_info_result/light_result.pyi b/tapo-py/tapo-py/tapo/responses/device_info_result/light_result.pyi index e1114e9..065cb5a 100644 --- a/tapo-py/tapo-py/tapo/responses/device_info_result/light_result.pyi +++ b/tapo-py/tapo-py/tapo/responses/device_info_result/light_result.pyi @@ -23,7 +23,6 @@ class DeviceInfoLightResult: device_on: bool on_time: int """The time in seconds this device has been ON since the last state change (ON/OFF).""" - overheated: bool nickname: str avatar: str has_set_location_info: bool @@ -36,6 +35,7 @@ class DeviceInfoLightResult: brightness: int default_states: DefaultLightState """The default state of a device to be used when internet connectivity is lost after a power cut.""" + overheated: bool def to_dict(self) -> dict: """Gets all the properties of this result as a dictionary. diff --git a/tapo-py/tapo-py/tapo/responses/device_info_result/plug_result.pyi b/tapo-py/tapo-py/tapo/responses/device_info_result/plug_result.pyi index e3e95ca..ffa2fd5 100644 --- a/tapo-py/tapo-py/tapo/responses/device_info_result/plug_result.pyi +++ b/tapo-py/tapo-py/tapo/responses/device_info_result/plug_result.pyi @@ -23,7 +23,6 @@ class DeviceInfoPlugResult: device_on: bool on_time: int """The time in seconds this device has been ON since the last state change (ON/OFF).""" - overheated: bool nickname: str avatar: str has_set_location_info: bool @@ -35,6 +34,7 @@ class DeviceInfoPlugResult: # Unique to this device default_states: DefaultPlugState """The default state of a device to be used when internet connectivity is lost after a power cut.""" + overheated: bool def to_dict(self) -> dict: """Gets all the properties of this result as a dictionary. diff --git a/tapo/src/responses/device_info_result/color_light.rs b/tapo/src/responses/device_info_result/color_light.rs index 4c975d0..2b645c4 100644 --- a/tapo/src/responses/device_info_result/color_light.rs +++ b/tapo/src/responses/device_info_result/color_light.rs @@ -30,7 +30,6 @@ pub struct DeviceInfoColorLightResult { /// The time in seconds this device has been ON since the last state change (ON/OFF). /// On v2 hardware this is always None. pub on_time: Option, - pub overheated: bool, pub nickname: String, pub avatar: String, pub has_set_location_info: bool, @@ -42,13 +41,14 @@ pub struct DeviceInfoColorLightResult { // Unique to this device // pub brightness: u8, + pub color_temp: u16, + /// The default state of a device to be used when internet connectivity is lost after a power cut. + pub default_states: DefaultColorLightState, pub dynamic_light_effect_enable: bool, pub dynamic_light_effect_id: Option, pub hue: Option, + pub overheated: bool, pub saturation: Option, - pub color_temp: u16, - /// The default state of a device to be used when internet connectivity is lost after a power cut. - pub default_states: DefaultColorLightState, } #[cfg(feature = "python")] diff --git a/tapo/src/responses/device_info_result/generic.rs b/tapo/src/responses/device_info_result/generic.rs index 4a37b65..b22003a 100644 --- a/tapo/src/responses/device_info_result/generic.rs +++ b/tapo/src/responses/device_info_result/generic.rs @@ -26,7 +26,6 @@ pub struct DeviceInfoGenericResult { pub device_on: Option, /// The time in seconds this device has been ON since the last state change (ON/OFF). pub on_time: Option, - pub overheated: bool, pub nickname: String, pub avatar: String, pub has_set_location_info: bool, diff --git a/tapo/src/responses/device_info_result/hub.rs b/tapo/src/responses/device_info_result/hub.rs index 7ba447a..dad5750 100644 --- a/tapo/src/responses/device_info_result/hub.rs +++ b/tapo/src/responses/device_info_result/hub.rs @@ -26,7 +26,6 @@ pub struct DeviceInfoHubResult { pub rssi: i16, pub specs: String, pub lang: String, - pub overheated: bool, pub nickname: String, pub avatar: String, pub has_set_location_info: bool, @@ -37,8 +36,9 @@ pub struct DeviceInfoHubResult { // // Unique to this device // - pub in_alarm: bool, pub in_alarm_source: String, + pub in_alarm: bool, + pub overheated: bool, } #[cfg(feature = "python")] diff --git a/tapo/src/responses/device_info_result/light.rs b/tapo/src/responses/device_info_result/light.rs index 38bd431..e6b0630 100644 --- a/tapo/src/responses/device_info_result/light.rs +++ b/tapo/src/responses/device_info_result/light.rs @@ -32,7 +32,6 @@ pub struct DeviceInfoLightResult { /// The time in seconds this device has been ON since the last state change (ON/OFF). /// On v2 hardware this is always None. pub on_time: Option, - pub overheated: bool, pub nickname: String, pub avatar: String, pub has_set_location_info: bool, @@ -46,6 +45,7 @@ pub struct DeviceInfoLightResult { pub brightness: u8, /// The default state of a device to be used when internet connectivity is lost after a power cut. pub default_states: DefaultLightState, + pub overheated: bool, } #[cfg(feature = "python")] diff --git a/tapo/src/responses/device_info_result/plug.rs b/tapo/src/responses/device_info_result/plug.rs index 5833979..77660f4 100644 --- a/tapo/src/responses/device_info_result/plug.rs +++ b/tapo/src/responses/device_info_result/plug.rs @@ -29,7 +29,6 @@ pub struct DeviceInfoPlugResult { pub device_on: bool, /// The time in seconds this device has been ON since the last state change (ON/OFF). pub on_time: u64, - pub overheated: bool, pub nickname: String, pub avatar: String, pub has_set_location_info: bool, @@ -42,6 +41,7 @@ pub struct DeviceInfoPlugResult { // /// The default state of a device to be used when internet connectivity is lost after a power cut. pub default_states: DefaultPlugState, + pub overheated: bool, } #[cfg(feature = "python")] diff --git a/tapo/src/responses/device_info_result/rgb_light_strip.rs b/tapo/src/responses/device_info_result/rgb_light_strip.rs index 039264b..3484fe0 100644 --- a/tapo/src/responses/device_info_result/rgb_light_strip.rs +++ b/tapo/src/responses/device_info_result/rgb_light_strip.rs @@ -26,7 +26,6 @@ pub struct DeviceInfoRgbLightStripResult { pub specs: String, pub lang: String, pub device_on: bool, - pub overheated: bool, pub nickname: String, pub avatar: String, pub has_set_location_info: bool, @@ -38,12 +37,13 @@ pub struct DeviceInfoRgbLightStripResult { // Unique to this device // pub brightness: u8, - pub hue: Option, - pub saturation: Option, - pub color_temp: u16, pub color_temp_range: [u16; 2], + pub color_temp: u16, /// The default state of a device to be used when internet connectivity is lost after a power cut. pub default_states: DefaultRgbLightStripState, + pub hue: Option, + pub overheated: bool, + pub saturation: Option, } impl TapoResponseExt for DeviceInfoRgbLightStripResult {} diff --git a/tapo/src/responses/device_info_result/rgbic_light_strip.rs b/tapo/src/responses/device_info_result/rgbic_light_strip.rs index 726140b..709b3a6 100644 --- a/tapo/src/responses/device_info_result/rgbic_light_strip.rs +++ b/tapo/src/responses/device_info_result/rgbic_light_strip.rs @@ -27,7 +27,6 @@ pub struct DeviceInfoRgbicLightStripResult { pub specs: String, pub lang: String, pub device_on: bool, - pub overheated: bool, pub nickname: String, pub avatar: String, pub has_set_location_info: bool, @@ -39,12 +38,13 @@ pub struct DeviceInfoRgbicLightStripResult { // Unique to this device // pub brightness: u8, - pub hue: Option, - pub saturation: Option, - pub color_temp: u16, pub color_temp_range: [u16; 2], + pub color_temp: u16, /// The default state of a device to be used when internet connectivity is lost after a power cut. pub default_states: DefaultRgbicLightStripState, + pub hue: Option, + pub overheated: bool, + pub saturation: Option, } impl TapoResponseExt for DeviceInfoRgbicLightStripResult {}