mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Add Reolink day night state sensor (#140825)
* Add day night state sensor * Update test_diagnostics.ambr
This commit is contained in:
parent
603557af73
commit
fdd36e457d
@ -365,6 +365,9 @@
|
||||
"battery_state": {
|
||||
"default": "mdi:battery-charging"
|
||||
},
|
||||
"day_night_state": {
|
||||
"default": "mdi:theme-light-dark"
|
||||
},
|
||||
"wifi_signal": {
|
||||
"default": "mdi:wifi"
|
||||
},
|
||||
|
@ -107,6 +107,17 @@ SENSORS = (
|
||||
value=lambda api, ch: BatteryEnum(api.battery_status(ch)).name,
|
||||
supported=lambda api, ch: api.supported(ch, "battery"),
|
||||
),
|
||||
ReolinkSensorEntityDescription(
|
||||
key="day_night_state",
|
||||
cmd_id=33,
|
||||
cmd_key="296",
|
||||
translation_key="day_night_state",
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
options=["day", "night", "led_day"],
|
||||
value=lambda api, ch: api.baichuan.day_night_state(ch),
|
||||
supported=lambda api, ch: api.supported(ch, "day_night_state"),
|
||||
),
|
||||
)
|
||||
|
||||
HOST_SENSORS = (
|
||||
|
@ -825,6 +825,14 @@
|
||||
"chargecomplete": "Charge complete"
|
||||
}
|
||||
},
|
||||
"day_night_state": {
|
||||
"name": "Day night state",
|
||||
"state": {
|
||||
"day": "Color",
|
||||
"night": "Black & white",
|
||||
"led_day": "Color with floodlight"
|
||||
}
|
||||
},
|
||||
"hdd_storage": {
|
||||
"name": "HDD {hdd_index} storage"
|
||||
},
|
||||
|
@ -62,6 +62,10 @@
|
||||
0,
|
||||
]),
|
||||
'cmd list': dict({
|
||||
'296': dict({
|
||||
'0': 1,
|
||||
'null': 1,
|
||||
}),
|
||||
'DingDongOpt': dict({
|
||||
'0': 2,
|
||||
'null': 2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user