Skip to content

Commit df653af

Browse files
committed
Add support for MQTT
This is currently untested.
1 parent be5acd2 commit df653af

File tree

15 files changed

+2070
-398
lines changed

15 files changed

+2070
-398
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ What it can do:
2626
- **Even more**
2727
There are some more goodies in to docs below. Enjoy!
2828

29-
_Note: currently this is limited to Blue switches using ZHA, but ideally Z2M and other Inovelli switches will be added in the future._
29+
_Note: currently this is limited to Blue switches using ZHA or Zigbee2MQTT, but other Inovelli switches will be added in the future._
3030

3131
**Configure notifications** for multiple switches easily:
3232

@@ -272,6 +272,12 @@ Restore state functionality is provided via a subset of entities:
272272

273273
If you disable these entities, it is possible that various other entities may not be restored after restarting Home Assistant.
274274

275+
##### Zigbee2MQTT
276+
277+
While supported by the Blue switch firmware, Zigbee2MQTT does not yet provide events with an `action` for when a notification expires (it only, supports for instance [`config_double`](https://www.zigbee2mqtt.io/devices/VZM35-SN.html#action-enum)).
278+
279+
This integration therefore handles notification expiration itself for switches configured with Zigbee2MQTT. This may change unexpectedly in the future—if and when it is possible, Lampie will change to sending durations to the firmware.
280+
275281
## More Screenshots
276282

277283
Once configured, the integration links the various entities to logical devices:

custom_components/lampie/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: LampieConfigEntry) -> bo
4545
_LOGGER.debug("setup %s with config:%s", entry.title, entry.data)
4646

4747
if DOMAIN not in hass.data:
48-
hass.data[DOMAIN] = LampieOrchestrator(hass)
48+
orchestrator = LampieOrchestrator(hass)
49+
hass.data[DOMAIN] = orchestrator
50+
51+
await orchestrator.setup()
4952

5053
coordinator = LampieUpdateCoordinator(hass, entry)
51-
orchestrator: LampieOrchestrator = hass.data[DOMAIN]
54+
orchestrator = hass.data[DOMAIN]
5255
orchestrator.add_coordinator(coordinator)
5356
entry.runtime_data = LampieConfigEntryRuntimeData(
5457
orchestrator=orchestrator,

custom_components/lampie/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"@wbyoung"
66
],
77
"config_flow": true,
8-
"dependencies": [],
8+
"dependencies": ["mqtt"],
99
"documentation": "https://github.com/wbyoung/lampie",
1010
"homekit": {},
1111
"iot_class": "calculated",

0 commit comments

Comments
 (0)