diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index de73121..d7ebe49 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -94,68 +94,20 @@ in { ]; } ]; - in lib.flatten (map roomPresents [ + in lib.flatten (map roomPresents (lib.flatten (map (name: [ { - roomGroup = "kitchen_room_lights"; - presentsGroup = "kitchen_room_present"; + roomGroup = "${name}_lights"; + presentsGroup = "${name}_present"; situation = "on"; } { - roomGroup = "living_room_lights"; - presentsGroup = "living_room_present"; - situation = "on"; - } - { - roomGroup = "floor_room_lights"; - presentsGroup = "floor_room_present"; - situation = "on"; - } - { - roomGroup = "bath_room_lights"; - presentsGroup = "bath_room_present"; - situation = "on"; - } - { - roomGroup = "bed_room_lights"; - presentsGroup = "bed_room_present"; - situation = "on"; - } - { - roomGroup = "kitchen_room_essentials"; - roomOffGroup = "kitchen_room"; - presentsGroup = "kitchen_room_present"; + roomGroup = "${name}_essential"; + roomOffGroup = "${name}_lights"; + presentsGroup = "${name}_present"; situation = "essential"; brightness = 30; } - { - roomGroup = "living_room_essential"; - roomOffGroup = "living_room_lights"; - presentsGroup = "living_room_present"; - situation = "essential"; - brightness = 30; - } - { - roomGroup = "floor_room_essential"; - roomOffGroup = "floor_room_lights"; - presentsGroup = "floor_room_present"; - situation = "essential"; - brightness = 30; - } - { - roomGroup = "bath_room_essential"; - roomOffGroup = "bath_room_lights"; - presentsGroup = "bath_room_present"; - situation = "essential"; - brightness = 30; - } - { - roomGroup = "bed_room_essential"; - roomOffGroup = "bed_room_lights"; - presentsGroup = "bed_room_present"; - situation = "essential"; - brightness = 30; - } - ]) ++ [ + ]) [ "living_room" "floor_room" "bath_room" "bed_room" "kitchen_room" ]))) ++ [ { alias = "set essential"; trigger = {