Skip to content

Commit

Permalink
Deprecate EnergyUsageResult's past24h, past7d, past30d and `p…
Browse files Browse the repository at this point in the history
…ast1y`
  • Loading branch information
mihai-dinculescu committed Feb 25, 2023
1 parent 34b68a5 commit cb239bb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ file. This change log follows the conventions of

- `get_energy_data` is now available for the *P110* devices.

### Changed

- `EnergyUsageResult`'s `past24h`, `past7d`, `past30d` and `past1y` fields are now deprecated. `get_energy_data` should be used instead. (thanks to @felixhauptmann)

## [v0.3.1] - 2023-02-19

### Added
Expand Down
16 changes: 16 additions & 0 deletions src/responses/energy_usage_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,28 @@ pub struct EnergyUsageResult {
/// Past 30 days energy usage in watts (W)
pub month_energy: u64,
/// Hourly energy usage for the past 24 hours in watts (W)
#[deprecated(
since = "0.4.0",
note = "P110 firmware v1.1.6 no longer returns this field. Use `ApiClient::<P110>::get_energy_data` instead."
)]
pub past24h: Option<Vec<u64>>,
/// Hourly energy usage by day for the past 7 days in watts (W)
#[deprecated(
since = "0.4.0",
note = "P110 firmware v1.1.6 no longer returns this field. Use `ApiClient::<P110>::get_energy_data` instead."
)]
pub past7d: Option<Vec<Vec<u64>>>,
/// Daily energy usage for the past 30 days in watts (W)
#[deprecated(
since = "0.4.0",
note = "P110 firmware v1.1.6 no longer returns this field. Use `ApiClient::<P110>::get_energy_data` instead."
)]
pub past30d: Option<Vec<u64>>,
/// Monthly energy usage for the past year in watts (W)
#[deprecated(
since = "0.4.0",
note = "P110 firmware v1.1.6 no longer returns this field. Use `ApiClient::<P110>::get_energy_data` instead."
)]
pub past1y: Option<Vec<u64>>,
}
impl TapoResponseExt for EnergyUsageResult {}

0 comments on commit cb239bb

Please sign in to comment.