From 988d3e93736609e69cf6c75e796b2981087780c5 Mon Sep 17 00:00:00 2001 From: DelusionalAI <59485008+DelusionalAI@users.noreply.github.com> Date: Thu, 6 Aug 2020 09:50:51 -0500 Subject: [PATCH] Add node firmware to ozw device registry (#38330) --- homeassistant/components/ozw/__init__.py | 1 - homeassistant/components/ozw/entity.py | 8 ++++++++ homeassistant/components/ozw/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/ozw/__init__.py b/homeassistant/components/ozw/__init__.py index bb48c180971..bbac0e843e9 100644 --- a/homeassistant/components/ozw/__init__.py +++ b/homeassistant/components/ozw/__init__.py @@ -114,7 +114,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): # Filter out CommandClasses we're definitely not interested in. if value.command_class in [ - CommandClass.VERSION, CommandClass.MANUFACTURER_SPECIFIC, ]: return diff --git a/homeassistant/components/ozw/entity.py b/homeassistant/components/ozw/entity.py index deb70af1bb5..ffec0feff07 100644 --- a/homeassistant/components/ozw/entity.py +++ b/homeassistant/components/ozw/entity.py @@ -7,6 +7,8 @@ from openzwavemqtt.const import ( EVENT_INSTANCE_STATUS_CHANGED, EVENT_VALUE_CHANGED, OZW_READY_STATES, + CommandClass, + ValueIndex, ) from openzwavemqtt.models.node import OZWNode from openzwavemqtt.models.value import OZWValue @@ -182,12 +184,18 @@ class ZWaveDeviceEntity(Entity): node = self.values.primary.node node_instance = self.values.primary.instance dev_id = create_device_id(node, self.values.primary.instance) + node_firmware = node.get_value( + CommandClass.VERSION, ValueIndex.VERSION_APPLICATION + ) device_info = { "identifiers": {(DOMAIN, dev_id)}, "name": create_device_name(node), "manufacturer": node.node_manufacturer_name, "model": node.node_product_name, } + if node_firmware is not None: + device_info["sw_version"] = node_firmware.value + # device with multiple instances is split up into virtual devices for each instance if node_instance > 1: parent_dev_id = create_device_id(node) diff --git a/homeassistant/components/ozw/manifest.json b/homeassistant/components/ozw/manifest.json index c6c96ed15a2..d2cf4772bb1 100644 --- a/homeassistant/components/ozw/manifest.json +++ b/homeassistant/components/ozw/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/ozw", "requirements": [ - "python-openzwave-mqtt==1.0.2" + "python-openzwave-mqtt==1.0.4" ], "after_dependencies": [ "mqtt" diff --git a/requirements_all.txt b/requirements_all.txt index e4578335c1f..980730ad845 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1734,7 +1734,7 @@ python-nest==4.1.0 python-nmap==0.6.1 # homeassistant.components.ozw -python-openzwave-mqtt==1.0.2 +python-openzwave-mqtt==1.0.4 # homeassistant.components.qbittorrent python-qbittorrent==0.4.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 6db238b23bc..4736d5d0046 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -791,7 +791,7 @@ python-miio==0.5.3 python-nest==4.1.0 # homeassistant.components.ozw -python-openzwave-mqtt==1.0.2 +python-openzwave-mqtt==1.0.4 # homeassistant.components.songpal python-songpal==0.12