Don't filter attributes when saving scene (#4278)

* Add cover attributes to scene editor

* Add more

* Remove filtering of attributes

* Update ha-scene-editor.ts
This commit is contained in:
Bram Kragten 2019-11-27 22:43:46 +01:00 committed by Paulus Schoutsen
parent bd5fe302eb
commit b8a026397b
2 changed files with 1 additions and 44 deletions

View File

@ -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 };
}

View File

@ -37,7 +37,6 @@ import {
saveScene,
SCENE_IGNORED_DOMAINS,
SceneEntities,
SCENE_SAVED_ATTRIBUTES,
applyScene,
activateScene,
} from "../../../data/scene";
@ -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> {