Skip to content

Commit

Permalink
Add devices to CustomEntity (#142)
Browse files Browse the repository at this point in the history
* Add devices to CustomEntity

HmIP-WGC, HmIP-WHS

* Update to pydevccu 0.1.0
  • Loading branch information
SukramJ authored Jan 7, 2022
1 parent eaac26e commit 7a25758
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 0.15.2 (2022-01-07)
- Add devices to CustomEntity
- HmIP-WGC
- HmIP-WHS
- Update to pydevccu 0.1.0

Version 0.15.1 (2022-01-07)
- Identify virtual remote by device type
- Fix Device Exporter / format output
Expand Down
2 changes: 2 additions & 0 deletions hahomematic/devices/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def make_ip_switch(
"HmIP-PCBS2": (make_ip_switch, [3, 7]),
"HmIP-PCBS-BAT": (make_ip_switch, [2]),
"HmIP-USBSM": (make_ip_switch, [2]),
"HmIP-WGC": (make_ip_switch, [2]),
"HmIP-WHS": (make_ip_switch, [1, 5]),
# HmIP-MIO16-PCB : Don't add it. Too much functionality. Device is better supported without custom entities.
# HmIP-MIOB : Don't add it. Too much functionality. Device is better supported without custom entities.
}
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pydevccu==0.0.9
pydevccu==0.1.0
aiohttp>=3.8.1
voluptuous>=0.12.2
pylint==2.12.1
Expand Down
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ def systemcallback(src, *args):
password=CCU_PASSWORD,
option_enable_virtual_channels=True,
).get_central()
config.INIT_TIMEOUT = 10
config.CACHE_DIR = "cache"
central_unit.callback_system_event = systemcallback
client1 = await ClientConfig(
central=central_unit,
Expand Down
14 changes: 5 additions & 9 deletions tests/test_central.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ async def test_central(central, loop) -> None:
assert central.version == "pydevccu 0.0.9"
assert central.clients["ccu-dev-hm"].model == "PyDevCCU"
assert central.get_client().model == "PyDevCCU"
assert len(central.hm_devices) == 294
assert len(central.hm_entities) == 2537
assert len(central.hm_devices) == 338
assert len(central.hm_entities) == 3267

data = {}
for device in central.hm_devices.values():
Expand All @@ -27,18 +27,18 @@ async def test_central(central, loop) -> None:
for entity in device.entities.values():
if entity.parameter not in data[device.device_type]:
data[device.device_type][entity.parameter] = f"{entity.hmtype}"
assert len(data) == 294
assert len(data) == 338
custom_entities = []
for device in central.hm_devices.values():
custom_entities.extend(device.custom_entities.values())
assert len(custom_entities) == 114
assert len(custom_entities) == 189

ce_channels = {}
for custom_entity in custom_entities:
if custom_entity.device_type not in ce_channels:
ce_channels[custom_entity.device_type] = []
ce_channels[custom_entity.device_type].append(custom_entity.channel_no)
assert len(ce_channels) == 67
assert len(ce_channels) == 81

entity_types = {}
for entity in central.hm_entities.values():
Expand All @@ -55,10 +55,6 @@ async def test_central(central, loop) -> None:
@pytest.mark.asyncio
async def test_device_set_data(central, pydev_ccu, loop) -> None:
"""Test callback."""
for pydev in pydev_ccu._rpcfunctions.devices:
if address := pydev.get('ADDRESS'):
if "VCU2721398" in address:
pass
assert central
assert pydev_ccu
old_value = await get_value_from_generic_entity(
Expand Down

0 comments on commit 7a25758

Please sign in to comment.