Skip to content
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

Add water consumption sensor #63

Merged

Conversation

slovdahl
Copy link
Contributor

Related to #58.

@slovdahl
Copy link
Contributor Author

Tested locally that HA starts and adds a sensor that shows 0 l consumed. Will check back once the washing machine or dishwasher has been used the next time.

@kloknibor kloknibor merged commit 9270664 into HomeAssistant-Mods:dev Sep 21, 2021
@slovdahl
Copy link
Contributor Author

Doesn't seem like my washing machine provides any water consumption 🤔 The dishwasher seems to do though. I'll need to follow this up in the coming days when the washing machine and dishwasher has been running more times.

@slovdahl slovdahl deleted the 58-water-consumption-sensor branch September 21, 2021 11:31
@slovdahl
Copy link
Contributor Author

Doesn't seem like my washing machine provides any water consumption 🤔 The dishwasher seems to do though. I'll need to follow this up in the coming days when the washing machine and dishwasher has been running more times.

Yeah, I suspect my refactoring broke it a little bit (see also #59 (comment)). This hopefully fixes it, I'll submit a PR:

diff --git custom_components/miele/sensor.py custom_components/miele/sensor.py
index a971a59..5e1f0d2 100644
--- custom_components/miele/sensor.py
+++ custom_components/miele/sensor.py
@@ -457,6 +457,12 @@ class MieleSensorEntity(SensorEntity):
         else:
             return result + " " + _map_key(self._key)

+    async def async_update(self):
+        if not self.device_id in self._hass.data[MIELE_DOMAIN][DATA_DEVICES]:
+            _LOGGER.debug("Miele device disappeared: {}".format(self.device_id))
+        else:
+            self._device = self._hass.data[MIELE_DOMAIN][DATA_DEVICES][self.device_id]
+

 class MieleStatusSensor(MieleRawSensor):
     def __init(self, client, device, key):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants