but only for newStyleChannels, which is already a breaking change of
most channels getting renamed for 4.3 anyway
Signed-off-by: Cody Cutrer <cody@cutrer.us>
if multiple DeviceTrigger components share a topic, and each
has a payload value configured, only messages matching that
payload should be delivered to the corresponding channel
Signed-off-by: Cody Cutrer <cody@cutrer.us>
In particular, use the color_mode attribute to tell us which color space to parse in,
instead of trying to guess. Some devices will fill out attributes not-pertinent to
the current color mode, and their math might be... less than optimal.
Also sync color temp and color channels when the color_mode is the opposite.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] Fix jinja usage in availability templates
Use the local Jinjava, instead of implicitly depending on the Jinja
transformation service.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
While it's useful in general to not have to copy/paste a MQTT message into a JSON
parser to verify syntax, it also includes details about fields that are the wrong
data type that a generic JSON parser won't catch. A la #17375.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] Improve support for Lock component
* handle state and command payloads differing (as they do by default)
* expose full state possibilities and OPEN command by adding
a TextValue channel
* Recognize intermediate lock states as unlocked on the switch channel
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] add support for Update component
This component is fairly non-standard - it doesn't add any channels.
Instead, it provides several properties to the thing, and also adds
a thing configuration allowing you to trigger an OTA update on a
Home Assistant device from MainUI.
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] improve Cover support
* Add support for covers that report position
* Handle when command and state values for OPEN/CLOSE/STOP
differ (as they do by default)
* Expose the full cover state, since it can have tell you
if the cover is moving or not
* Handle covers that have a position only, but not a state
* add constants to clarify up/down values
* Be sure to parse percents from strings in RollshutterValue
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] interpret a dimmable light as OFF properly from zigbee2mqtt
zigbee2mqtt can send a brightness of say 99, with a state of OFF, when a bulb is
off. make sure if state is sent, it overrides all other inferences
* handle brightness but not color bulbs
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
I.e. Button, Scene, and Binary Sensors.
Also ensure we set up the CommandDescription, since some value types mights use it.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] Add support for Button component
* use a StringValue instead of an OnOffValue
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Follow on to #15427
ring-mqtt sends `"name": ""`, not `"name": null` or simply omitting it,
so be sure to handle that way as well
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] handle null component name
channels from such components will not have a group. this is
now done by zigbee2mqtt for the "default" component of a device,
such as the light. HASS encourages this as of release 2023.8
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [mqtt.homeassistant] support color temp on JSON schema lights
also adds a color_mode channel if color temp is possible, so you can
know how the bulb is behaving
* put color mode channel construction into buildChannels()
---------
Signed-off-by: Cody Cutrer <cody@cutrer.us>