mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Add lawn mower entity state, icon and color (#17558)
* start of lawn mower entity in the frontend * added colours for states * remove schedule states as no longer needed * change mowing to teal * remove docking as not included in architecture discussion and was missed
This commit is contained in:
parent
d0a6e727f2
commit
196c15ff3e
@ -49,6 +49,7 @@ import {
|
||||
mdiProgressClock,
|
||||
mdiRayVertex,
|
||||
mdiRemote,
|
||||
mdiRobotMower,
|
||||
mdiRobotVacuum,
|
||||
mdiScriptText,
|
||||
mdiSineWave,
|
||||
@ -99,6 +100,7 @@ export const FIXED_DOMAIN_ICONS = {
|
||||
input_number: mdiRayVertex,
|
||||
input_select: mdiFormatListBulleted,
|
||||
input_text: mdiFormTextbox,
|
||||
lawn_mower: mdiRobotMower,
|
||||
light: mdiLightbulb,
|
||||
mailbox: mdiMailbox,
|
||||
notify: mdiCommentAlert,
|
||||
@ -187,6 +189,7 @@ export const DOMAINS_WITH_CARD = [
|
||||
"input_number",
|
||||
"input_text",
|
||||
"humidifier",
|
||||
"lawn_mower",
|
||||
"lock",
|
||||
"media_player",
|
||||
"number",
|
||||
|
@ -26,6 +26,7 @@ export const FIXED_DOMAIN_STATES = {
|
||||
humidifier: ["on", "off"],
|
||||
input_boolean: ["on", "off"],
|
||||
input_button: [],
|
||||
lawn_mower: ["error", "paused", "mowing", "docked"],
|
||||
light: ["on", "off"],
|
||||
lock: ["jammed", "locked", "locking", "unlocked", "unlocking"],
|
||||
media_player: [
|
||||
|
@ -34,6 +34,8 @@ export function stateActive(stateObj: HassEntity, state?: string): boolean {
|
||||
case "device_tracker":
|
||||
case "person":
|
||||
return compareState !== "not_home";
|
||||
case "lawn_mower":
|
||||
return ["mowing", "error"].includes(compareState);
|
||||
case "lock":
|
||||
return compareState !== "locked";
|
||||
case "media_player":
|
||||
|
@ -22,6 +22,7 @@ const STATE_COLORED_DOMAIN = new Set([
|
||||
"group",
|
||||
"humidifier",
|
||||
"input_boolean",
|
||||
"lawn_mower",
|
||||
"light",
|
||||
"lock",
|
||||
"media_player",
|
||||
|
@ -158,6 +158,8 @@ documentContainer.innerHTML = `<custom-style>
|
||||
--state-device_tracker-home-color: var(--green-color);
|
||||
--state-fan-active-color: var(--cyan-color);
|
||||
--state-humidifier-on-color: var(--blue-color);
|
||||
--state-lawn_mower-error-color: var(--red-color);
|
||||
--state-lawn_mower-mowing-color: var(--teal-color);
|
||||
--state-light-active-color: var(--amber-color);
|
||||
--state-lock-jammed-color: var(--red-color);
|
||||
--state-lock-locked-color: var(--green-color);
|
||||
|
Loading…
x
Reference in New Issue
Block a user