mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-15 21:26:29 +00:00
Change User LED to System Health LED (#4586)
This commit is contained in:
parent
e11ff64b15
commit
9322b68d47
@ -46,6 +46,7 @@ ATTR_SIGNED = "signed"
|
||||
ATTR_STARTUP_TIME = "startup_time"
|
||||
ATTR_SUBSYSTEM = "subsystem"
|
||||
ATTR_SYSFS = "sysfs"
|
||||
ATTR_SYSTEM_HEALTH_LED = "system_health_led"
|
||||
ATTR_TIME_DETECTED = "time_detected"
|
||||
ATTR_UPDATE_TYPE = "update_type"
|
||||
ATTR_USE_NTP = "use_ntp"
|
||||
|
@ -20,7 +20,6 @@ from ..const import (
|
||||
ATTR_SERIAL,
|
||||
ATTR_SIZE,
|
||||
ATTR_UPDATE_AVAILABLE,
|
||||
ATTR_USER_LED,
|
||||
ATTR_VERSION,
|
||||
ATTR_VERSION_LATEST,
|
||||
)
|
||||
@ -34,6 +33,7 @@ from .const import (
|
||||
ATTR_DEVICE,
|
||||
ATTR_DISKS,
|
||||
ATTR_MODEL,
|
||||
ATTR_SYSTEM_HEALTH_LED,
|
||||
ATTR_VENDOR,
|
||||
)
|
||||
from .utils import api_process, api_validate
|
||||
@ -55,7 +55,7 @@ SCHEMA_GREEN_OPTIONS = vol.Schema(
|
||||
{
|
||||
vol.Optional(ATTR_ACTIVITY_LED): vol.Boolean(),
|
||||
vol.Optional(ATTR_POWER_LED): vol.Boolean(),
|
||||
vol.Optional(ATTR_USER_LED): vol.Boolean(),
|
||||
vol.Optional(ATTR_SYSTEM_HEALTH_LED): vol.Boolean(),
|
||||
}
|
||||
)
|
||||
# pylint: enable=no-value-for-parameter
|
||||
@ -121,7 +121,7 @@ class APIOS(CoreSysAttributes):
|
||||
return {
|
||||
ATTR_ACTIVITY_LED: self.sys_dbus.agent.board.green.activity_led,
|
||||
ATTR_POWER_LED: self.sys_dbus.agent.board.green.power_led,
|
||||
ATTR_USER_LED: self.sys_dbus.agent.board.green.user_led,
|
||||
ATTR_SYSTEM_HEALTH_LED: self.sys_dbus.agent.board.green.user_led,
|
||||
}
|
||||
|
||||
@api_process
|
||||
@ -135,8 +135,8 @@ class APIOS(CoreSysAttributes):
|
||||
if ATTR_POWER_LED in body:
|
||||
self.sys_dbus.agent.board.green.power_led = body[ATTR_POWER_LED]
|
||||
|
||||
if ATTR_USER_LED in body:
|
||||
self.sys_dbus.agent.board.green.user_led = body[ATTR_USER_LED]
|
||||
if ATTR_SYSTEM_HEALTH_LED in body:
|
||||
self.sys_dbus.agent.board.green.user_led = body[ATTR_SYSTEM_HEALTH_LED]
|
||||
|
||||
self.sys_dbus.agent.board.green.save_data()
|
||||
|
||||
|
@ -177,7 +177,7 @@ async def test_api_board_green_info(
|
||||
result = await resp.json()
|
||||
assert result["data"]["activity_led"] is True
|
||||
assert result["data"]["power_led"] is True
|
||||
assert result["data"]["user_led"] is True
|
||||
assert result["data"]["system_health_led"] is True
|
||||
|
||||
assert (await api_client.get("/os/boards/yellow")).status == 400
|
||||
assert (await api_client.get("/os/boards/supervised")).status == 400
|
||||
@ -203,7 +203,11 @@ async def test_api_board_green_options(
|
||||
with patch.object(BoardProxy, "save_data") as save_data:
|
||||
resp = await api_client.post(
|
||||
"/os/boards/green",
|
||||
json={"activity_led": False, "power_led": False, "user_led": False},
|
||||
json={
|
||||
"activity_led": False,
|
||||
"power_led": False,
|
||||
"system_health_led": False,
|
||||
},
|
||||
)
|
||||
assert resp.status == 200
|
||||
save_data.assert_called_once()
|
||||
|
Loading…
x
Reference in New Issue
Block a user