Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions src/data/scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,6 @@ export const SCENE_IGNORED_DOMAINS = [
"zone",
];

export const SCENE_SAVED_ATTRIBUTES = {
light: [
"brightness",
"color_temp",
"effect",
"rgb_color",
"xy_color",
"hs_color",
],
media_player: [
"is_volume_muted",
"volume_level",
"sound_mode",
"source",
"media_content_id",
"media_content_type",
],
climate: [
"target_temperature",
"target_temperature_high",
"target_temperature_low",
"target_humidity",
"fan_mode",
"swing_mode",
"hvac_mode",
"preset_mode",
],
vacuum: ["cleaning_mode"],
fan: ["speed", "current_direction"],
water_heather: ["temperature", "operation_mode"],
};

export interface SceneEntity extends HassEntityBase {
attributes: HassEntityAttributeBase & { id?: string };
}
Expand Down
13 changes: 1 addition & 12 deletions src/panels/config/scene/ha-scene-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
saveScene,
SCENE_IGNORED_DOMAINS,
SceneEntities,
SCENE_SAVED_ATTRIBUTES,
applyScene,
activateScene,
} from "../../../data/scene";
Expand Down Expand Up @@ -617,17 +616,7 @@ export class HaSceneEditor extends SubscribeMixin(LitElement) {
if (!stateObj) {
return;
}
const domain = computeDomain(entityId);
const attributes = {};
for (const attribute in stateObj.attributes) {
if (
SCENE_SAVED_ATTRIBUTES[domain] &&
SCENE_SAVED_ATTRIBUTES[domain].includes(attribute)
) {
attributes[attribute] = stateObj.attributes[attribute];
}
}
return { ...attributes, state: stateObj.state };
return { ...stateObj.attributes, state: stateObj.state };
}

private async _saveScene(): Promise<void> {
Expand Down