From 7bc7acec760816b982eee7c39be9a994cd38ae5c Mon Sep 17 00:00:00 2001 From: Seb Ruiz Date: Wed, 15 Dec 2021 12:12:33 +1100 Subject: [PATCH 1/3] Remove deprecated and replace with . Closes #94 --- custom_components/bhyve/__init__.py | 2 +- custom_components/bhyve/switch.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/bhyve/__init__.py b/custom_components/bhyve/__init__.py index c955cca..46718f6 100644 --- a/custom_components/bhyve/__init__.py +++ b/custom_components/bhyve/__init__.py @@ -243,7 +243,7 @@ def device_class(self): return self._device_class @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" return self._attrs diff --git a/custom_components/bhyve/switch.py b/custom_components/bhyve/switch.py index eea6d35..a4c35d6 100644 --- a/custom_components/bhyve/switch.py +++ b/custom_components/bhyve/switch.py @@ -206,7 +206,7 @@ def __init__(self, hass, bhyve, program, device, icon): self._available = True @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the device state attributes.""" attrs = { From 9ac5684f3c900e61afacd65d85b68d4df8f9d5af Mon Sep 17 00:00:00 2001 From: Seb Ruiz Date: Wed, 15 Dec 2021 12:15:52 +1100 Subject: [PATCH 2/3] Add logging for device connection/disconnection events #91 --- custom_components/bhyve/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/bhyve/__init__.py b/custom_components/bhyve/__init__.py index 46718f6..068e9ba 100644 --- a/custom_components/bhyve/__init__.py +++ b/custom_components/bhyve/__init__.py @@ -374,8 +374,10 @@ def update(device_id, data): """Update the state.""" event = data.get("event") if event == "device_disconnected": + _LOGGER.warning("Device {} disconnected and is no longer available".format(self.name)) self._available = False elif event == "device_connected": + _LOGGER.info("Device {} reconnected and is now available".format(self.name)) self._available = True if self._should_handle_event(event, data): _LOGGER.info( From bbd4e3cd812d17e287b6fa3f79e6bff813b971fb Mon Sep 17 00:00:00 2001 From: Seb Ruiz Date: Wed, 15 Dec 2021 12:33:29 +1100 Subject: [PATCH 3/3] Bump version to 2.1.1 --- custom_components/bhyve/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/bhyve/manifest.json b/custom_components/bhyve/manifest.json index 2990a04..bf8b5aa 100644 --- a/custom_components/bhyve/manifest.json +++ b/custom_components/bhyve/manifest.json @@ -1,6 +1,6 @@ { "domain": "bhyve", - "version": "2.1.0", + "version": "2.1.1", "name": "Orbit BHyve Integration", "documentation": "https://github.com/sebr/bhyve-home-assistant/blob/master/README.md", "dependencies": [],