Commit Graph

3 Commits

Author SHA1 Message Date
Darell Tan
d4daef7bce Introduce constructors for ExposeMapping
This should allow the ExposeMapping struct to be changed without
constantly impacting its callers.
2024-11-24 15:25:17 +08:00
Darell Tan
4eac1ba2a9 Fix access check for light expose features
Some dimmers expose features with state|set instead of state|get|set.
Relax the check to cater for more light/dimmers.
2023-08-05 02:17:06 +08:00
Darell Tan
c61da984c9 Add support for dimmers and dimmable bulbs
The exposes entry looks similar to a switch, except the type is a
"light" and it has `state` and `brightness`. Tested only on single
channel dimmers.

Also added a PercentageTranslator to translate between the HomeKit
`brightness`, which is a percentage, to/from an arbitrary numeric value
in Z2M.
2023-06-25 02:20:01 +08:00