Skip to content

Commit

Permalink
Remove overheated from DeviceInfoGenericResult
Browse files Browse the repository at this point in the history
Addresses #216.
  • Loading branch information
mihai-dinculescu committed May 20, 2024
1 parent c423a92 commit 4ad1107
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 26 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

This comment has been minimized.

Copy link
@sledgemhammer

sledgemhammer Aug 17, 2024

please remove or adjust as the api changed in json response : "overheated" had become 'overheat_status'

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class DeviceInfoHubResult:
rssi: int
specs: str
lang: str
overheated: bool
nickname: str
avatar: str
has_set_location_info: bool
Expand All @@ -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

This comment has been minimized.

Copy link
@sledgemhammer

sledgemhammer Aug 17, 2024

please remove or adjust as the api changed in json response : "overheated" had become 'overheat_status'


def to_dict(self) -> dict:
"""Gets all the properties of this result as a dictionary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

This comment has been minimized.

Copy link
@sledgemhammer

sledgemhammer Aug 17, 2024

please remove or adjust as the api changed in json response : "overheated" had become 'overheat_status'


def to_dict(self) -> dict:
"""Gets all the properties of this result as a dictionary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

This comment has been minimized.

Copy link
@sledgemhammer

sledgemhammer Aug 17, 2024

please remove or adjust as the api changed in json response : "overheated" had become 'overheat_status'


def to_dict(self) -> dict:
"""Gets all the properties of this result as a dictionary.
Expand Down
8 changes: 4 additions & 4 deletions tapo/src/responses/device_info_result/color_light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64>,
pub overheated: bool,
pub nickname: String,
pub avatar: String,
pub has_set_location_info: bool,
Expand All @@ -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<String>,
pub hue: Option<u16>,
pub overheated: bool,
pub saturation: Option<u16>,
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")]
Expand Down
1 change: 0 additions & 1 deletion tapo/src/responses/device_info_result/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub struct DeviceInfoGenericResult {
pub device_on: Option<bool>,
/// The time in seconds this device has been ON since the last state change (ON/OFF).
pub on_time: Option<u64>,
pub overheated: bool,
pub nickname: String,
pub avatar: String,
pub has_set_location_info: bool,
Expand Down
4 changes: 2 additions & 2 deletions tapo/src/responses/device_info_result/hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion tapo/src/responses/device_info_result/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64>,
pub overheated: bool,
pub nickname: String,
pub avatar: String,
pub has_set_location_info: bool,
Expand All @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion tapo/src/responses/device_info_result/plug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")]
Expand Down
8 changes: 4 additions & 4 deletions tapo/src/responses/device_info_result/rgb_light_strip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -38,12 +37,13 @@ pub struct DeviceInfoRgbLightStripResult {
// Unique to this device
//
pub brightness: u8,
pub hue: Option<u16>,
pub saturation: Option<u16>,
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<u16>,
pub overheated: bool,
pub saturation: Option<u16>,
}

impl TapoResponseExt for DeviceInfoRgbLightStripResult {}
Expand Down
8 changes: 4 additions & 4 deletions tapo/src/responses/device_info_result/rgbic_light_strip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -39,12 +38,13 @@ pub struct DeviceInfoRgbicLightStripResult {
// Unique to this device
//
pub brightness: u8,
pub hue: Option<u16>,
pub saturation: Option<u16>,
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<u16>,
pub overheated: bool,
pub saturation: Option<u16>,
}

impl TapoResponseExt for DeviceInfoRgbicLightStripResult {}
Expand Down

0 comments on commit 4ad1107

Please sign in to comment.