mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 01:06:35 +00:00
Update demo lights (#9011)
This commit is contained in:
parent
0c12586019
commit
16996f25af
@ -246,11 +246,15 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
|
|||||||
|
|
||||||
"light.living_room_lights": {
|
"light.living_room_lights": {
|
||||||
entity_id: "light.living_room_lights",
|
entity_id: "light.living_room_lights",
|
||||||
state: "off",
|
state: "on",
|
||||||
attributes: {
|
attributes: {
|
||||||
min_mireds: 111,
|
min_mireds: 111,
|
||||||
max_mireds: 400,
|
max_mireds: 400,
|
||||||
|
brightness: 175,
|
||||||
|
color_temp: 300,
|
||||||
|
supported_color_modes: ["brightness", "color_temp"],
|
||||||
friendly_name: "Living Room Lights",
|
friendly_name: "Living Room Lights",
|
||||||
|
color_mode: "color_temp",
|
||||||
supported_features: 55,
|
supported_features: 55,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -263,13 +267,27 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
|
|||||||
},
|
},
|
||||||
"light.kitchen_lights": {
|
"light.kitchen_lights": {
|
||||||
entity_id: "light.kitchen_lights",
|
entity_id: "light.kitchen_lights",
|
||||||
|
state: "on",
|
||||||
|
attributes: {
|
||||||
|
min_mireds: 111,
|
||||||
|
max_mireds: 400,
|
||||||
|
brightness: 200,
|
||||||
|
rgb_color: [255, 175, 96],
|
||||||
|
supported_color_modes: ["brightness", "color_temp", "rgb"],
|
||||||
|
color_mode: "rgb",
|
||||||
|
friendly_name: "Kitchen Lights",
|
||||||
|
supported_features: 55,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"light.lifx5": {
|
||||||
|
entity_id: "light.lifx5",
|
||||||
state: "off",
|
state: "off",
|
||||||
attributes: {
|
attributes: {
|
||||||
friendly_name: "Kitchen Lights",
|
supported_color_modes: ["brightness"],
|
||||||
|
friendly_name: "Garage Lights",
|
||||||
supported_features: 1,
|
supported_features: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"sensor.plexspy": {
|
"sensor.plexspy": {
|
||||||
entity_id: "sensor.plexspy",
|
entity_id: "sensor.plexspy",
|
||||||
state: "0",
|
state: "0",
|
||||||
@ -482,16 +500,6 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
|
|||||||
icon: "hademo:history",
|
icon: "hademo:history",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"light.lifx5": {
|
|
||||||
entity_id: "light.lifx5",
|
|
||||||
state: "on",
|
|
||||||
attributes: {
|
|
||||||
min_mireds: 111,
|
|
||||||
max_mireds: 400,
|
|
||||||
friendly_name: "Garage Lights",
|
|
||||||
supported_features: 55,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"sensor.alok_to_home": {
|
"sensor.alok_to_home": {
|
||||||
entity_id: "sensor.alok_to_home",
|
entity_id: "sensor.alok_to_home",
|
||||||
state: "41",
|
state: "41",
|
||||||
|
@ -1114,6 +1114,9 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
min_mireds: 153,
|
min_mireds: 153,
|
||||||
max_mireds: 500,
|
max_mireds: 500,
|
||||||
brightness: 63,
|
brightness: 63,
|
||||||
|
color_temp: 200,
|
||||||
|
supported_color_modes: ["brightness", "color_temp", "rgb"],
|
||||||
|
color_mode: "color_temp",
|
||||||
friendly_name: "Upstairs lights",
|
friendly_name: "Upstairs lights",
|
||||||
supported_features: 63,
|
supported_features: 63,
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
@ -1125,6 +1128,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
attributes: {
|
attributes: {
|
||||||
friendly_name: "Walk in closet lights",
|
friendly_name: "Walk in closet lights",
|
||||||
supported_features: 41,
|
supported_features: 41,
|
||||||
|
supported_color_modes: ["brightness", "color_temp"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:wall-sconce",
|
icon: "mdi:wall-sconce",
|
||||||
},
|
},
|
||||||
@ -1136,6 +1140,8 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
brightness: 254,
|
brightness: 254,
|
||||||
friendly_name: "Outdoor lights",
|
friendly_name: "Outdoor lights",
|
||||||
supported_features: 41,
|
supported_features: 41,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
|
color_mode: "brightness",
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:wall-sconce",
|
icon: "mdi:wall-sconce",
|
||||||
},
|
},
|
||||||
@ -1148,6 +1154,8 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
max_mireds: 500,
|
max_mireds: 500,
|
||||||
brightness: 128,
|
brightness: 128,
|
||||||
color_temp: 366,
|
color_temp: 366,
|
||||||
|
supported_color_modes: ["brightness", "color_temp", "rgb"],
|
||||||
|
color_mode: "color_temp",
|
||||||
effect_list: ["colorloop"],
|
effect_list: ["colorloop"],
|
||||||
friendly_name: "Downstairs lights",
|
friendly_name: "Downstairs lights",
|
||||||
supported_features: 63,
|
supported_features: 63,
|
||||||
@ -1307,6 +1315,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
attributes: {
|
attributes: {
|
||||||
min_mireds: 153,
|
min_mireds: 153,
|
||||||
max_mireds: 500,
|
max_mireds: 500,
|
||||||
|
supported_color_modes: ["brightness", "color_temp"],
|
||||||
is_deconz_group: false,
|
is_deconz_group: false,
|
||||||
friendly_name: "Bedside Lamp",
|
friendly_name: "Bedside Lamp",
|
||||||
supported_features: 63,
|
supported_features: 63,
|
||||||
@ -1320,6 +1329,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
attributes: {
|
attributes: {
|
||||||
min_mireds: 153,
|
min_mireds: 153,
|
||||||
max_mireds: 500,
|
max_mireds: 500,
|
||||||
|
supported_color_modes: ["brightness", "color_temp"],
|
||||||
is_deconz_group: false,
|
is_deconz_group: false,
|
||||||
friendly_name: "Floorlamp Reading Light",
|
friendly_name: "Floorlamp Reading Light",
|
||||||
supported_features: 43,
|
supported_features: 43,
|
||||||
@ -1335,6 +1345,8 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
max_mireds: 500,
|
max_mireds: 500,
|
||||||
brightness: 128,
|
brightness: 128,
|
||||||
color_temp: 366,
|
color_temp: 366,
|
||||||
|
supported_color_modes: ["brightness", "color_temp", "rgb"],
|
||||||
|
color_mode: "color_temp",
|
||||||
effect_list: ["colorloop"],
|
effect_list: ["colorloop"],
|
||||||
is_deconz_group: false,
|
is_deconz_group: false,
|
||||||
friendly_name: "Hallway window light",
|
friendly_name: "Hallway window light",
|
||||||
@ -1349,6 +1361,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
attributes: {
|
attributes: {
|
||||||
brightness: 77,
|
brightness: 77,
|
||||||
is_deconz_group: false,
|
is_deconz_group: false,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
friendly_name: "Isa Ceiling Light",
|
friendly_name: "Isa Ceiling Light",
|
||||||
supported_features: 41,
|
supported_features: 41,
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
@ -1363,6 +1376,8 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
max_mireds: 500,
|
max_mireds: 500,
|
||||||
brightness: 150,
|
brightness: 150,
|
||||||
color_temp: 366,
|
color_temp: 366,
|
||||||
|
supported_color_modes: ["brightness", "color_temp"],
|
||||||
|
color_mode: "color_temp",
|
||||||
effect_list: ["colorloop"],
|
effect_list: ["colorloop"],
|
||||||
is_deconz_group: false,
|
is_deconz_group: false,
|
||||||
friendly_name: "Floorlamp",
|
friendly_name: "Floorlamp",
|
||||||
@ -1377,6 +1392,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
attributes: {
|
attributes: {
|
||||||
friendly_name: "Bedroom Ceiling Light",
|
friendly_name: "Bedroom Ceiling Light",
|
||||||
supported_features: 41,
|
supported_features: 41,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:ceiling-light",
|
icon: "mdi:ceiling-light",
|
||||||
},
|
},
|
||||||
@ -1387,6 +1403,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
attributes: {
|
attributes: {
|
||||||
friendly_name: "Nightlight",
|
friendly_name: "Nightlight",
|
||||||
supported_features: 17,
|
supported_features: 17,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:lamp",
|
icon: "mdi:lamp",
|
||||||
},
|
},
|
||||||
@ -1753,6 +1770,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
power_consumption: 2.2,
|
power_consumption: 2.2,
|
||||||
friendly_name: "Upstairs Hallway Light",
|
friendly_name: "Upstairs Hallway Light",
|
||||||
supported_features: 33,
|
supported_features: 33,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:ceiling-light",
|
icon: "mdi:ceiling-light",
|
||||||
},
|
},
|
||||||
@ -1768,6 +1786,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
power_consumption: 0,
|
power_consumption: 0,
|
||||||
friendly_name: "Dining Room Light",
|
friendly_name: "Dining Room Light",
|
||||||
supported_features: 33,
|
supported_features: 33,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:ceiling-light",
|
icon: "mdi:ceiling-light",
|
||||||
},
|
},
|
||||||
@ -1783,6 +1802,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
power_consumption: 0,
|
power_consumption: 0,
|
||||||
friendly_name: "Living room Spotlights",
|
friendly_name: "Living room Spotlights",
|
||||||
supported_features: 33,
|
supported_features: 33,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:track-light",
|
icon: "mdi:track-light",
|
||||||
},
|
},
|
||||||
@ -1799,6 +1819,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
power_consumption: 2.5,
|
power_consumption: 2.5,
|
||||||
friendly_name: "Passage Lights",
|
friendly_name: "Passage Lights",
|
||||||
supported_features: 33,
|
supported_features: 33,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:track-light",
|
icon: "mdi:track-light",
|
||||||
},
|
},
|
||||||
@ -1843,6 +1864,7 @@ export const demoEntitiesTeachingbirds: DemoConfig["entities"] = () =>
|
|||||||
power_consumption: 37.4,
|
power_consumption: 37.4,
|
||||||
friendly_name: "Kitchen Lights",
|
friendly_name: "Kitchen Lights",
|
||||||
supported_features: 33,
|
supported_features: 33,
|
||||||
|
supported_color_modes: ["brightness"],
|
||||||
custom_ui_state_card: "state-card-custom-ui",
|
custom_ui_state_card: "state-card-custom-ui",
|
||||||
icon: "mdi:track-light",
|
icon: "mdi:track-light",
|
||||||
},
|
},
|
||||||
|
@ -81,9 +81,27 @@ class LightEntity extends Entity {
|
|||||||
|
|
||||||
if (service === "turn_on") {
|
if (service === "turn_on") {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
let { brightness, hs_color, brightness_pct } = data;
|
let { hs_color, brightness_pct, rgb_color, color_temp } = data;
|
||||||
brightness = (255 * brightness_pct) / 100;
|
const attrs = { ...this.attributes };
|
||||||
this.update("on", { ...this.attributes, brightness, hs_color });
|
if (brightness_pct) {
|
||||||
|
attrs.brightness = (255 * brightness_pct) / 100;
|
||||||
|
} else if (!attrs.brightness) {
|
||||||
|
attrs.brightness = 255;
|
||||||
|
}
|
||||||
|
if (hs_color) {
|
||||||
|
attrs.color_mode = "hs";
|
||||||
|
attrs.hs_color = hs_color;
|
||||||
|
}
|
||||||
|
if (rgb_color) {
|
||||||
|
attrs.color_mode = "rgb";
|
||||||
|
attrs.rgb_color = rgb_color;
|
||||||
|
}
|
||||||
|
if (color_temp) {
|
||||||
|
attrs.color_mode = "color_temp";
|
||||||
|
attrs.color_temp = color_temp;
|
||||||
|
delete attrs.rgb_color;
|
||||||
|
}
|
||||||
|
this.update("on", attrs);
|
||||||
} else if (service === "turn_off") {
|
} else if (service === "turn_off") {
|
||||||
this.update("off");
|
this.update("off");
|
||||||
} else if (service === "toggle") {
|
} else if (service === "toggle") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user