Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.


10 changes: 5 additions & 5 deletions custom_components/usr_r16/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)

Expand Down Expand Up @@ -213,4 +213,4 @@ async def async_added_to_hass(self):
f"usr_r16_device_available_{self._entry_id}",
self._availability_callback,
)
)
)
10 changes: 5 additions & 5 deletions custom_components/usr_r16/manifest.json
Original file line number Diff line number Diff line change
@@ -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
}
}
4 changes: 2 additions & 2 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}