-
-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use deprecated depth
property
#1124
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rytilahti
reviewed
Aug 30, 2021
miio/airhumidifier.py
Outdated
@@ -199,8 +199,8 @@ def water_level(self) -> Optional[int]: | |||
|
|||
If water tank is full, depth is 125. | |||
""" | |||
if self.depth is not None and self.depth <= 125: | |||
return int(self.depth / 1.25) | |||
if self.data.get("depth") is not None and self.data["depth"] <= 125: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduce a new local variable depth
to avoid typing self.data
again:
depth = self.data.get("depth")
...
Otherwise looks ok for me :-)
rytilahti
approved these changes
Aug 31, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
rytilahti
added a commit
that referenced
this pull request
Sep 1, 2021
* Fix usage of deprecated depth for airhumidifer [Full Changelog](0.5.7...0.5.8) **Implemented enhancements:** - vacuum: skip timezone call if there are no timers [\#1122](#1122) ([rytilahti](https://github.com/rytilahti)) **Closed issues:** - Smart Mi Standing fan 3 \(Xiaomi Pedestal Fan 3, zhimi.fan.za5\) [\#788](#788) **Merged pull requests:** - readme: add micloudfaker to list of related projects [\#1127](#1127) ([unrelentingtech](https://github.com/unrelentingtech)) - Update readme with section for related projects [\#1126](#1126) ([rytilahti](https://github.com/rytilahti)) - add lumi.plug.mmeu01 - ZNCZ04LM [\#1125](#1125) ([starkillerOG](https://github.com/starkillerOG)) - Do not use deprecated `depth` property [\#1124](#1124) ([bieniu](https://github.com/bieniu)) - vacuum: remove long-deprecated 'return\_list' for clean\_details [\#1123](#1123) ([rytilahti](https://github.com/rytilahti)) - deprecate Fan{V2,SA1,ZA1,ZA3,ZA4} in favor of model kwarg [\#1119](#1119) ([rytilahti](https://github.com/rytilahti)) - Add support for Smartmi Standing Fan 3 \(zhimi.fan.za5\) [\#1087](#1087) ([rnovatorov](https://github.com/rnovatorov))
Merged
rytilahti
added a commit
that referenced
this pull request
Sep 1, 2021
* Add support for smart mi standing fan 3 (zhimi.fan.za5) * Fix usage of deprecated depth for airhumidifer [Full Changelog](0.5.7...0.5.8) **Implemented enhancements:** - vacuum: skip timezone call if there are no timers [\#1122](#1122) ([rytilahti](https://github.com/rytilahti)) **Closed issues:** - Smart Mi Standing fan 3 \(Xiaomi Pedestal Fan 3, zhimi.fan.za5\) [\#788](#788) **Merged pull requests:** - readme: add micloudfaker to list of related projects [\#1127](#1127) ([unrelentingtech](https://github.com/unrelentingtech)) - Update readme with section for related projects [\#1126](#1126) ([rytilahti](https://github.com/rytilahti)) - add lumi.plug.mmeu01 - ZNCZ04LM [\#1125](#1125) ([starkillerOG](https://github.com/starkillerOG)) - Do not use deprecated `depth` property [\#1124](#1124) ([bieniu](https://github.com/bieniu)) - vacuum: remove long-deprecated 'return\_list' for clean\_details [\#1123](#1123) ([rytilahti](https://github.com/rytilahti)) - deprecate Fan{V2,SA1,ZA1,ZA3,ZA4} in favor of model kwarg [\#1119](#1119) ([rytilahti](https://github.com/rytilahti)) - Add support for Smartmi Standing Fan 3 \(zhimi.fan.za5\) [\#1087](#1087) ([rnovatorov](https://github.com/rnovatorov))
rytilahti
added a commit
that referenced
this pull request
Sep 1, 2021
* Add support for smart mi standing fan 3 (zhimi.fan.za5) * Fix usage of deprecated depth for airhumidifer [Full Changelog](0.5.7...0.5.8) **Implemented enhancements:** - vacuum: skip timezone call if there are no timers [\#1122](#1122) ([rytilahti](https://github.com/rytilahti)) **Closed issues:** - Smart Mi Standing fan 3 \(Xiaomi Pedestal Fan 3, zhimi.fan.za5\) [\#788](#788) **Merged pull requests:** - readme: add micloudfaker to list of related projects [\#1127](#1127) ([unrelentingtech](https://github.com/unrelentingtech)) - Update readme with section for related projects [\#1126](#1126) ([rytilahti](https://github.com/rytilahti)) - add lumi.plug.mmeu01 - ZNCZ04LM [\#1125](#1125) ([starkillerOG](https://github.com/starkillerOG)) - Do not use deprecated `depth` property [\#1124](#1124) ([bieniu](https://github.com/bieniu)) - vacuum: remove long-deprecated 'return\_list' for clean\_details [\#1123](#1123) ([rytilahti](https://github.com/rytilahti)) - deprecate Fan{V2,SA1,ZA1,ZA3,ZA4} in favor of model kwarg [\#1119](#1119) ([rytilahti](https://github.com/rytilahti)) - Add support for Smartmi Standing Fan 3 \(zhimi.fan.za5\) [\#1087](#1087) ([rnovatorov](https://github.com/rnovatorov))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes my stupid mistake started here #1089
We don't want to use deprecated
depth
property to calulate thewater_level
property.