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" 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..0d4b751 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(): @@ -129,9 +129,9 @@ async def connect(): hass.data[DOMAIN][entry.entry_id][DATA_DEVICE_REGISTER] = client # Load entites - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(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) @@ -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 + } 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 + }