mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 17:14:28 +05:00
add adc port and template rendering values
This commit is contained in:
@@ -16,8 +16,9 @@ from homeassistant.const import (
|
||||
CONF_TYPE, CONF_UNIT_OF_MEASUREMENT,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.template import Template
|
||||
from .entities import MegaPushEntity
|
||||
from .const import CONF_KEY, TEMP, HUM, W1, W1BUS
|
||||
from .const import CONF_KEY, TEMP, HUM, W1, W1BUS, CONF_CONV_TEMPLATE
|
||||
from .hub import MegaD
|
||||
import re
|
||||
|
||||
@@ -164,6 +165,10 @@ class Mega1WSensor(MegaPushEntity):
|
||||
ret = str(ret)
|
||||
except:
|
||||
ret = None
|
||||
tmpl: Template = self.customize.get(CONF_CONV_TEMPLATE)
|
||||
if tmpl is not None and self.hass is not None:
|
||||
tmpl.hass = self.hass
|
||||
ret = tmpl.async_render({'value': ret})
|
||||
return ret
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user