mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 06:36:45 +00:00
parent
f0f76066f3
commit
f7314adff4
@ -14,6 +14,7 @@ from esphome.const import (
|
|||||||
CONF_VALUE,
|
CONF_VALUE,
|
||||||
CONF_WIDTH,
|
CONF_WIDTH,
|
||||||
)
|
)
|
||||||
|
from esphome.cpp_generator import IntLiteral
|
||||||
|
|
||||||
from ..automation import action_to_code
|
from ..automation import action_to_code
|
||||||
from ..defines import (
|
from ..defines import (
|
||||||
@ -188,6 +189,8 @@ class MeterType(WidgetType):
|
|||||||
rotation = 90 + (360 - scale_conf[CONF_ANGLE_RANGE]) / 2
|
rotation = 90 + (360 - scale_conf[CONF_ANGLE_RANGE]) / 2
|
||||||
if CONF_ROTATION in scale_conf:
|
if CONF_ROTATION in scale_conf:
|
||||||
rotation = await lv_angle.process(scale_conf[CONF_ROTATION])
|
rotation = await lv_angle.process(scale_conf[CONF_ROTATION])
|
||||||
|
if isinstance(rotation, IntLiteral):
|
||||||
|
rotation = int(str(rotation)) // 10
|
||||||
with LocalVariable(
|
with LocalVariable(
|
||||||
"meter_var", "lv_meter_scale_t", lv_expr.meter_add_scale(var)
|
"meter_var", "lv_meter_scale_t", lv_expr.meter_add_scale(var)
|
||||||
) as meter_var:
|
) as meter_var:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user