-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
The automation.managed_switch workflow is very useful, being able to take a callback and list of entities to react to, then turning that into service calls.
automation.managed_switch({
context,
entity_id: "switch.dragonfly_lights",
onUpdate: [officePlants, meetingMode, isHome],
shouldBeOn() {
if (!isHome.is_on) {
return false;
}
if (meetingMode.is_on) {
return true;
}
return !automation.time.isBetween("AM1:30", "PM4");
},
});Synapse builds on the pattern with SettableConfiguration, which is set on specific properties across the library.
synapse.switch({
context,
is_on: {
current() {
return !binary_sensor.is_on;
},
onUpdate: [binary_sensor],
},
name: "Example switch",
});For hass internal domains, this type of functionality should be available directly on the entity proxy.
hass.refBy.id("switch.example").manage({
current() {
return true | "on"
},
onUpdate: [],
schedule: ...
})This will require some manual mapping of domains to specific service calls in order to work correctly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request