Skip to content

Commit

Permalink
Merge pull request #35 from koenhendriks/28-hass-label-entity-value-d…
Browse files Browse the repository at this point in the history
…oes-not-match-button-value

Write label state to home assistant, closing #28
  • Loading branch information
koenhendriks committed Jan 14, 2024
2 parents 8560726 + d1ff5fc commit cc0cc2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/button_plus/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

from homeassistant.components.text import TextEntity

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.components.mqtt import client as mqtt
Expand Down Expand Up @@ -102,6 +103,7 @@ async def async_set_value(self, value: str) -> None:
_LOGGER.debug(f"ButtonPlus label update to {label_topic} with new value: {value}")
await mqtt.async_publish(hass=self.hass, topic=label_topic, payload=value, qos=0, retain=True)
self._attr_native_value = value
self.async_write_ha_state()


class ButtonPlusLabel(ButtonPlusText):
Expand Down

0 comments on commit cc0cc2c

Please sign in to comment.