-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Added time left for recommended sensor cleaning #119
Conversation
Unfortunately I am unable to test these changes, however I believe they should work.
miio/vacuumcontainers.py
Outdated
@property | ||
def sensor_dirty_left(self) -> timedelta: | ||
return self.side_brush_total - self.sensor_dirty | ||
|
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.
blank line contains whitespace
miio/vacuumcontainers.py
Outdated
@@ -292,6 +292,7 @@ def __init__(self, data: Dict[str, Any]) -> None: | |||
self.main_brush_total = timedelta(hours=300) | |||
self.side_brush_total = timedelta(hours=200) | |||
self.filter_total = timedelta(hours=150) | |||
self.sensors_total = timedelta(hours=30) |
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.
trailing whitespace
Github browser based editor sucks!
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 for your patch! I added a couple of comments that needs to be handled before merging this. Could you also please adjust vacuum_cli.py
to print out the left value as it is done for other consumables?
miio/vacuumcontainers.py
Outdated
@@ -292,6 +292,7 @@ def __init__(self, data: Dict[str, Any]) -> None: | |||
self.main_brush_total = timedelta(hours=300) | |||
self.side_brush_total = timedelta(hours=200) | |||
self.filter_total = timedelta(hours=150) | |||
self.sensors_total = timedelta(hours=30) |
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.
Use singular here, as property is "sensor_dirty". Or if you thing it's worth renaming it now, maybe introduce a new, renamed property and @deprecate
the old one.
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 for taking the time to have a look. I have fixed the issues.
miio/vacuumcontainers.py
Outdated
@@ -321,6 +322,10 @@ def filter_left(self) -> timedelta: | |||
def sensor_dirty(self) -> timedelta: | |||
return pretty_seconds(self.data["sensor_dirty_time"]) | |||
|
|||
@property | |||
def sensor_dirty_left(self) -> timedelta: | |||
return self.side_brush_total - self.sensor_dirty |
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.
side_brush_total
is wrong.
miio/vacuumcontainers.py
Outdated
@@ -324,7 +324,7 @@ def sensor_dirty(self) -> timedelta: | |||
|
|||
@property | |||
def sensor_dirty_left(self) -> timedelta: | |||
return self.side_brush_total - self.sensor_dirty | |||
return self.sensor_dirty_total - self.sensor_dirty |
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.
This is still wrong :-) Also, please update vacuum_cli.py
accordingly to display the new property.
1 similar comment
I am far from a programmer. Hope this is everything done correctly:) Thanks for your patience. |
Seems to work fine, I just tested it locally :-)
(cleaning the sensors / reseting the status is overdue, it seems..) |
Unfortunately I am unable to test these changes, however I believe they should work.