Fix missing Shelly external input (#47028)

* Add support for external input (Shelly 1/1pm add-on)

* Make external sensor naming consistent

* Fix case consistency
pull/47041/head
Simone Chemelli 2021-02-25 09:51:18 +01:00 committed by GitHub
parent 47938a1355
commit 65a2f07a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -73,6 +73,11 @@ SENSORS = {
default_enabled=False,
removal_condition=is_momentary_input,
),
("sensor", "extInput"): BlockAttributeDescription(
name="External Input",
device_class=DEVICE_CLASS_POWER,
default_enabled=False,
),
("sensor", "motion"): BlockAttributeDescription(
name="Motion", device_class=DEVICE_CLASS_MOTION
),
@ -86,7 +91,7 @@ REST_SENSORS = {
default_enabled=False,
),
"fwupdate": RestAttributeDescription(
name="Firmware update",
name="Firmware Update",
icon="mdi:update",
value=lambda status, _: status["update"]["has_update"],
default_enabled=False,

View File

@ -133,7 +133,7 @@ SENSORS = {
available=lambda block: block.sensorOp == "normal",
),
("sensor", "extTemp"): BlockAttributeDescription(
name="Temperature",
name="External Temperature",
unit=temperature_unit,
value=lambda value: round(value, 1),
device_class=sensor.DEVICE_CLASS_TEMPERATURE,
@ -155,7 +155,7 @@ SENSORS = {
icon="mdi:angle-acute",
),
("relay", "totalWorkTime"): BlockAttributeDescription(
name="Lamp life",
name="Lamp Life",
unit=PERCENTAGE,
icon="mdi:progress-wrench",
value=lambda value: round(100 - (value / 3600 / SHAIR_MAX_WORK_HOURS), 1),