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,
|
mdiProgressClock,
|
||||||
mdiRayVertex,
|
mdiRayVertex,
|
||||||
mdiRemote,
|
mdiRemote,
|
||||||
|
mdiRobotMower,
|
||||||
mdiRobotVacuum,
|
mdiRobotVacuum,
|
||||||
mdiScriptText,
|
mdiScriptText,
|
||||||
mdiSineWave,
|
mdiSineWave,
|
||||||
@ -99,6 +100,7 @@ export const FIXED_DOMAIN_ICONS = {
|
|||||||
input_number: mdiRayVertex,
|
input_number: mdiRayVertex,
|
||||||
input_select: mdiFormatListBulleted,
|
input_select: mdiFormatListBulleted,
|
||||||
input_text: mdiFormTextbox,
|
input_text: mdiFormTextbox,
|
||||||
|
lawn_mower: mdiRobotMower,
|
||||||
light: mdiLightbulb,
|
light: mdiLightbulb,
|
||||||
mailbox: mdiMailbox,
|
mailbox: mdiMailbox,
|
||||||
notify: mdiCommentAlert,
|
notify: mdiCommentAlert,
|
||||||
@ -187,6 +189,7 @@ export const DOMAINS_WITH_CARD = [
|
|||||||
"input_number",
|
"input_number",
|
||||||
"input_text",
|
"input_text",
|
||||||
"humidifier",
|
"humidifier",
|
||||||
|
"lawn_mower",
|
||||||
"lock",
|
"lock",
|
||||||
"media_player",
|
"media_player",
|
||||||
"number",
|
"number",
|
||||||
|
@ -26,6 +26,7 @@ export const FIXED_DOMAIN_STATES = {
|
|||||||
humidifier: ["on", "off"],
|
humidifier: ["on", "off"],
|
||||||
input_boolean: ["on", "off"],
|
input_boolean: ["on", "off"],
|
||||||
input_button: [],
|
input_button: [],
|
||||||
|
lawn_mower: ["error", "paused", "mowing", "docked"],
|
||||||
light: ["on", "off"],
|
light: ["on", "off"],
|
||||||
lock: ["jammed", "locked", "locking", "unlocked", "unlocking"],
|
lock: ["jammed", "locked", "locking", "unlocked", "unlocking"],
|
||||||
media_player: [
|
media_player: [
|
||||||
|
@ -34,6 +34,8 @@ export function stateActive(stateObj: HassEntity, state?: string): boolean {
|
|||||||
case "device_tracker":
|
case "device_tracker":
|
||||||
case "person":
|
case "person":
|
||||||
return compareState !== "not_home";
|
return compareState !== "not_home";
|
||||||
|
case "lawn_mower":
|
||||||
|
return ["mowing", "error"].includes(compareState);
|
||||||
case "lock":
|
case "lock":
|
||||||
return compareState !== "locked";
|
return compareState !== "locked";
|
||||||
case "media_player":
|
case "media_player":
|
||||||
|
@ -22,6 +22,7 @@ const STATE_COLORED_DOMAIN = new Set([
|
|||||||
"group",
|
"group",
|
||||||
"humidifier",
|
"humidifier",
|
||||||
"input_boolean",
|
"input_boolean",
|
||||||
|
"lawn_mower",
|
||||||
"light",
|
"light",
|
||||||
"lock",
|
"lock",
|
||||||
"media_player",
|
"media_player",
|
||||||
|
@ -158,6 +158,8 @@ documentContainer.innerHTML = `<custom-style>
|
|||||||
--state-device_tracker-home-color: var(--green-color);
|
--state-device_tracker-home-color: var(--green-color);
|
||||||
--state-fan-active-color: var(--cyan-color);
|
--state-fan-active-color: var(--cyan-color);
|
||||||
--state-humidifier-on-color: var(--blue-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-light-active-color: var(--amber-color);
|
||||||
--state-lock-jammed-color: var(--red-color);
|
--state-lock-jammed-color: var(--red-color);
|
||||||
--state-lock-locked-color: var(--green-color);
|
--state-lock-locked-color: var(--green-color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user