From 3dc510335b921cbe06dc5d5097ea29ffe1491de0 Mon Sep 17 00:00:00 2001 From: Eric MORAND Date: Mon, 19 Aug 2024 10:22:07 +0200 Subject: [PATCH 1/5] Remove deprecated functions --- README.md | 8 +------- custom_components/usr_r16/__init__.py | 4 ++-- custom_components/usr_r16/manifest.json | 10 +++++----- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6a3b89f..84381c2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,6 @@ # USR-R16 for Home Assistant -[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/hacs/integration) -![Validate with hassfest](https://github.com/blindlight86/HA_USR-R16/workflows/Validate%20with%20hassfest/badge.svg) +This is a fork of https://github.com/blindlight86/HA_USR-R16 Home Assitant component. -This is a custom component for Home Assistant to integrate [USR-R16 16x relay switches module](https://www.zhize.com.cn/wangluojidianqi/16luwangluojidianqi.html). -![usr-r16](https://www.zhize.com.cn/images/201711/goods_img/228_P_1511503732233.jpg) - -## HOW TO INSTALL -The installation via HACS is recommended. You can find this custom component in the HACS store under integrations. diff --git a/custom_components/usr_r16/__init__.py b/custom_components/usr_r16/__init__.py index a65d941..c95c262 100644 --- a/custom_components/usr_r16/__init__.py +++ b/custom_components/usr_r16/__init__.py @@ -130,7 +130,7 @@ async def connect(): # Load entites hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, "switch") + await hass.config_entries.async_forward_entry_setups(entry, ["switch"]) ) _LOGGER.info("Connected to USR-R16 device: %s", address) @@ -213,4 +213,4 @@ async def async_added_to_hass(self): f"usr_r16_device_available_{self._entry_id}", self._availability_callback, ) - ) \ No newline at end of file + ) diff --git a/custom_components/usr_r16/manifest.json b/custom_components/usr_r16/manifest.json index 2d951cf..1e28eae 100644 --- a/custom_components/usr_r16/manifest.json +++ b/custom_components/usr_r16/manifest.json @@ -1,15 +1,15 @@ { "domain": "usr_r16", "name": "USR r16", - "version": "0.0.1", - "documentation": "https://github.com/blindlight86/USR-R16", - "issue_tracker": "https://github.com/blindlight86/HA_USR-R16/issues", + "version": "1.0.0", + "documentation": "https://github.com/Elwinmage/ha-usr-r16-component", + "issue_tracker": "https://github.com/Elwinmage/ha-usr-r16-component/issues", "requirements": [ "usr-r16==0.0.4" ], "dependencies": [], "codeowners": [ - "@blindlight" + "@Elwinmage" ], "config_flow": true - } \ No newline at end of file + } From 487373eb30baf4b4ca95abd83315bd996ca8c62c Mon Sep 17 00:00:00 2001 From: Eric MORAND Date: Mon, 19 Aug 2024 10:24:26 +0200 Subject: [PATCH 2/5] Renamed --- hacs.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hacs.json b/hacs.json index 645f5e0..4f2c1e3 100644 --- a/hacs.json +++ b/hacs.json @@ -1,8 +1,8 @@ { - "name": "USR-R16 16路网络继电器", + "name": "USR-R16 Perso", "domains": ["switch"], "render_readme": true, "homeassistant": "2022.7.5", "country": ["CN"], "iot_class": ["Assumed State", "Local Push"] - } \ No newline at end of file + } From b57e3e20b15386947d582ff97fddf72731a33f4b Mon Sep 17 00:00:00 2001 From: Eric MORAND Date: Mon, 17 Mar 2025 23:18:31 +0100 Subject: [PATCH 3/5] change log level of connection message from warning to info --- custom_components/usr_r16/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/usr_r16/__init__.py b/custom_components/usr_r16/__init__.py index c95c262..e272486 100644 --- a/custom_components/usr_r16/__init__.py +++ b/custom_components/usr_r16/__init__.py @@ -107,7 +107,7 @@ def disconnected(): @callback def reconnected(): """Schedule reconnect after connection has been lost.""" - _LOGGER.warning("USR-R16 %s connected", address) + _LOGGER.info("USR-R16 %s connected", address) async_dispatcher_send(hass, f'usr_r16_device_available_{entry.entry_id}', True) async def connect(): From 15d257d335269fa38be0a85dfa9ce46055d0b97b Mon Sep 17 00:00:00 2001 From: Elwinmage <52315693+Elwinmage@users.noreply.github.com> Date: Thu, 12 Jun 2025 09:51:41 +0200 Subject: [PATCH 4/5] Update __init__.py COMPATIBLE TO 2025.6 --- custom_components/usr_r16/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/usr_r16/__init__.py b/custom_components/usr_r16/__init__.py index e272486..0d4b751 100644 --- a/custom_components/usr_r16/__init__.py +++ b/custom_components/usr_r16/__init__.py @@ -129,9 +129,9 @@ async def connect(): hass.data[DOMAIN][entry.entry_id][DATA_DEVICE_REGISTER] = client # Load entites - hass.async_create_task( - await hass.config_entries.async_forward_entry_setups(entry, ["switch"]) - ) + #hass.async_create_task( + await hass.config_entries.async_forward_entry_setups(entry, ["switch"]) + #) _LOGGER.info("Connected to USR-R16 device: %s", address) From 8f2229dde4afc1e4501a62b90c1ffb21994155a6 Mon Sep 17 00:00:00 2001 From: Elwinmage <52315693+Elwinmage@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:00:54 +0200 Subject: [PATCH 5/5] Create release.yml --- .github/workflows/release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..56e91f2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,13 @@ +name: Release +on: + push: + tags: + - "v*.*.*" +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: "Set version number from trigger's tag" + run: | + yq -i -o json '.version="${{ github.ref_name }}"' \ + "${{ github.workspace }}/custom_components/redsea/manifest.json"