Skip to content

Commit 1eb4ffc

Browse files
authored
merge: create release 0.5.4-beta (#59)
merge: create release 0.5.4-beta
2 parents 835ee60 + f96cabf commit 1eb4ffc

File tree

13 files changed

+364
-115
lines changed

13 files changed

+364
-115
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Update the manifest file."""
2+
import json
3+
import os
4+
import sys
5+
6+
7+
def update_manifest():
8+
"""Update the manifest file."""
9+
version = "0.0.0"
10+
for index, value in enumerate(sys.argv):
11+
if value in ["--version", "-V"]:
12+
version = sys.argv[index + 1]
13+
14+
with open(
15+
f"{os.getcwd()}/custom_components/easycontrols/manifest.json"
16+
) as manifestfile:
17+
manifest = json.load(manifestfile)
18+
19+
manifest["version"] = version
20+
21+
with open(
22+
f"{os.getcwd()}/custom_components/easycontrols/manifest.json", "w"
23+
) as manifestfile:
24+
manifestfile.write(json.dumps(manifest, indent=4, sort_keys=True))
25+
26+
27+
update_manifest()

.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release_zip_file:
9+
name: Prepare release asset
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repository
13+
uses: actions/checkout@v2
14+
15+
- name: Get version
16+
id: version
17+
uses: home-assistant/actions/helpers/version@master
18+
19+
- name: "Set manifest version number"
20+
run: |
21+
python3 ${{ github.workspace }}/.github/scripts/update_hacs_manifest.py --version ${{ steps.version.outputs.version }}
22+
23+
- name: Create zip
24+
run: |
25+
cd custom_components/easycontrols
26+
zip homeassistant-easycontrols.zip -r ./
27+
28+
- name: Upload zip to release
29+
uses: svenstaro/upload-release-action@v1-release
30+
with:
31+
repo_token: ${{ secrets.GITHUB_TOKEN }}
32+
file: ./custom_components/easycontrols/homeassistant-easycontrols.zip
33+
asset_name: homeassistant-easycontrols.zip
34+
tag: ${{ github.ref }}
35+
overwrite: true

.github/workflows/validate.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
9+
jobs:
10+
validate:
11+
runs-on: "ubuntu-latest"
12+
steps:
13+
- uses: "actions/checkout@v2"
14+
- name: HACS validation
15+
uses: "hacs/action@main"
16+
with:
17+
category: "integration"

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Laszlo Jakab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# homeassistant-easycontrols
2+
3+
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg)](https://github.com/hacs/integration)
4+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/laszlojakab/homeassistant-easycontrols)
5+
![GitHub](https://img.shields.io/github/license/laszlojakab/homeassistant-easycontrols)
6+
![GitHub all releases](https://img.shields.io/github/downloads/laszlojakab/homeassistant-easycontrols/total)
7+
[![Donate](https://img.shields.io/badge/donate-Coffee-yellow.svg)](https://www.buymeacoffee.com/laszlojakab)
8+
29
Helios EasyControls Modbus TCP/IP integration for [Home Assistant](https://www.home-assistant.io/)
310

411
## Usage:

custom_components/easycontrols/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def get_device_info(controller: ThreadSafeController) -> DeviceInfo:
8383
name=controller.device_name,
8484
manufacturer='Helios',
8585
model=controller.model,
86-
sw_version=controller.version
86+
sw_version=controller.version,
87+
configuration_url=f'http://{controller.host}'
8788
)
8889

8990

custom_components/easycontrols/binary_sensor.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
DEVICE_CLASS_OPENING, DEVICE_CLASS_PROBLEM, BinarySensorEntity,
99
BinarySensorEntityDescription)
1010
from homeassistant.config_entries import ConfigEntry
11-
from homeassistant.const import CONF_MAC
11+
from homeassistant.const import CONF_MAC, ENTITY_CATEGORY_DIAGNOSTIC
1212
from homeassistant.helpers.entity import DeviceInfo
1313
from homeassistant.helpers.entity_platform import AddEntitiesCallback
1414
from homeassistant.helpers.typing import HomeAssistantType
@@ -98,7 +98,8 @@ async def async_setup_entry(
9898
key="bypass",
9999
name=f'{controller.device_name} bypass',
100100
icon='mdi:delta',
101-
device_class=DEVICE_CLASS_OPENING
101+
device_class=DEVICE_CLASS_OPENING,
102+
entity_category=ENTITY_CATEGORY_DIAGNOSTIC
102103
),
103104
),
104105
EasyControlBinarySensor(
@@ -108,7 +109,8 @@ async def async_setup_entry(
108109
key="filter_change",
109110
name=f'{controller.device_name} filter change',
110111
icon='mdi:air-filter',
111-
device_class=DEVICE_CLASS_PROBLEM
112+
device_class=DEVICE_CLASS_PROBLEM,
113+
entity_category=ENTITY_CATEGORY_DIAGNOSTIC
112114
)
113115
)
114116
])

custom_components/easycontrols/const.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
DATA_CONTROLLER = 'controller'
88

9-
MODE_MANUAL = 'manual'
10-
MODE_AUTO = 'auto'
11-
129
INFO_FILTER_CHANGE_FLAG = 0x01
1310

1411
VARIABLE_ARTICLE_DESCRIPTION = StrModbusVariable('v00000', 31)
@@ -30,7 +27,6 @@
3027
VARIABLE_SERIAL_NUMBER = StrModbusVariable('v00303', 16)
3128
VARIABLE_SUPPLY_AIR_RPM = IntModbusVariable('v00348', 4)
3229
VARIABLE_EXTRACT_AIR_RPM = IntModbusVariable('v00349', 4)
33-
VARIABLE_HOLIDAY_MODE = IntModbusVariable('v00601', 1)
3430
VARIABLE_FILTER_CHANGE = BoolModbusVariable('v01031')
3531
VARIABLE_SUPPLY_AIR_FAN_STAGE = IntModbusVariable('v01050', 1)
3632
VARIABLE_EXTRACT_AIR_FAN_STAGE = IntModbusVariable('v01051', 1)
@@ -48,11 +44,15 @@
4844
VARIABLE_BYPASS = BoolModbusVariable('v02119')
4945
VARIABLE_HUMIDITY_EXTRACT_AIR = IntModbusVariable('v02136', 3)
5046

51-
PRESET_NOT_SET = 'not set'
5247
PRESET_PARTY = 'party'
5348
PRESET_STANDBY = 'standby'
54-
PRESET_HOLIDAY_INTERVAL = 'holiday interval'
55-
PRESET_HOLIDAY_CONSTANT = 'holiday constant'
49+
PRESET_AUTO = 'auto'
50+
51+
SERVICE_START_PARTY_MODE = 'start_party_mode'
52+
SERVICE_STOP_PARTY_MODE = 'stop_party_mode'
53+
54+
OPERATING_MODE_MANUAL = 1
55+
OPERATING_MODE_AUTO = 0
5656

5757
ERRORS = {
5858
0x00000001: 'Fan speed error «Supply air» (outside air)',

0 commit comments

Comments
 (0)