Add mqtt sensor configurable state encoding for sensor and binary_sensor platform (#60447)
* Add mqtt sensor state encoding * Make encoding attribute not specific to states * Move encoding attribute to schema base
This commit is contained in:
parent
7469f083fd
commit
2a2a20fcb3
8 changed files with 76 additions and 7 deletions
|
@ -10,13 +10,10 @@ from homeassistant.core import HassJob, callback
|
|||
from homeassistant.helpers import config_validation as cv, template
|
||||
|
||||
from .. import mqtt
|
||||
from .const import CONF_QOS, CONF_TOPIC
|
||||
from .const import CONF_ENCODING, CONF_QOS, CONF_TOPIC, DEFAULT_ENCODING, DEFAULT_QOS
|
||||
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
CONF_ENCODING = "encoding"
|
||||
DEFAULT_ENCODING = "utf-8"
|
||||
DEFAULT_QOS = 0
|
||||
|
||||
TRIGGER_SCHEMA = cv.TRIGGER_BASE_SCHEMA.extend(
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue