Skip to content

Commit

Permalink
Merge pull request #4 from lunDreame/Dimming
Browse files Browse the repository at this point in the history
Dimming
  • Loading branch information
lunDreame authored Sep 21, 2024
2 parents 5fd3bcd + 1a1dd76 commit a71ded2
Show file tree
Hide file tree
Showing 25 changed files with 1,122 additions and 757 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request_target]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
37 changes: 0 additions & 37 deletions .github/workflows/release.yml

This file was deleted.

24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ BESTIN 월패드 1.0/2.0 사용자들을 위한 통합
1. **기기 및 서비스** 메뉴에서 **통합구성요소 추가하기**를 클릭합니다.
2. **브랜드 이름 검색** 탭에 `BESTIN`을 입력하고 검색 결과에서 클릭합니다.
3. 아래 설명에 따라 설정을 진행합니다:
- **설정 전에 로컬 통신 스마트홈 연동 둘 다 진행하는 경우 로컬 통신 설정 이후에 스마트홈
연동을 진행해 주세요.**
- 스마트홈 연동을 먼저 하는 경우 엔트리가 잘못 설정되어 제대로 기기가 생성되지 않습니다. 버그로 추정되며 수정전까지 위 방법으로 설정해 주세요.

#### 1. 로컬 통신 설정
- **IP 주소** 입력:
Expand All @@ -42,20 +45,21 @@ BESTIN 월패드 1.0/2.0 사용자들을 위한 통합
- 통신기 `EW11 or USB to 485` 설치 (자세한 내용은 [여기](./guide/install.md) 참조)

- 정상적으로 연결되었는지 확인하려면 시리얼 포트몬 프로그램을 통해 시리얼 데이터 확인. BESTIN 월패드의 경우 02로 시작하며 [예시 데이터](./guide/packet_dump.txt) 참조
- 디밍 세대의 경우 [해당](./guide/dimming_packet_dump.txt) 데이터 참조

## 기능
![추가된 기기](./images/added_devices.png)

| 기기 | 지원 | 속성 |
| --------- | ----- | -------------------------- |
| 콘센트 | O | 실시간 사용량, 대기전력자동차단 |
| 도어락 | O | |
| 엘리베이터 | O | 2.0의 경우 지원 |
| HEMS | O | 실시간, 총합 사용량 |
| 환기 | O | 프리셋 (자연풍) |
| 가스 | O | |
| 조명 | O | 디밍 조명 (지원 X) |
| 난방 | O | |
| 기기 | 지원 | 속성 |
|-----------|------|-------------------------------|
| 콘센트 | O | 실시간 사용량, 대기전력자동차단 |
| 조명 | O | 디밍, 색온도 |
| 엘리베이터 | O | 2.0의 경우 지원 |
| HEMS | O | 실시간, 총합 사용량 |
| 환기 | O | 프리셋 (자연풍) |
| 가스 | O | |
| 도어락 | O | |
| 난방 | O | |

- 추가 기기나 속성이 필요하면 이슈 탭에 등록해 주세요.
- 1.2.0 버전 이후부터 IPARK 스마트홈 연동을 지원합니다.
Expand Down
10 changes: 7 additions & 3 deletions custom_components/bestin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
LOGGER.debug(f"entry_data: {entry.data}, unique_id: {entry.unique_id}")

if "version" not in entry.data:
# Serial connect
if not await hub.connect():
LOGGER.debug(f"Hub connection failed: {hub.hub_id}")
await hub.shutdown()
LOGGER.warning(f"Hub connection failed: {hub.hub_id}")
await hub.async_close()

hass.data[DOMAIN].pop(entry.entry_id)
return False

Expand All @@ -29,7 +31,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
else:
await hub.async_initialize_center()

entry.async_on_unload(hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, hub.shutdown))
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, hub.shutdown)
)
entry.async_on_unload(entry.add_update_listener(_async_update_listener))

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
Expand Down
Loading

0 comments on commit a71ded2

Please sign in to comment.