diff --git a/devices/homie/modules/home-assistant/docs/functions.nix b/devices/homie/modules/home-assistant/docs/functions.nix index a7967b87..f931555f 100644 --- a/devices/homie/modules/home-assistant/docs/functions.nix +++ b/devices/homie/modules/home-assistant/docs/functions.nix @@ -3,6 +3,30 @@ let inherit (import ../../../../../lib {}) lib; inherit (lib) concatStrings concatStringsSep splitString; in [ + { + spec = { + name = "get_attributes"; + description = "Get attributes of any home assistant entity"; + parameters = { + type = "object"; + + properties = { + entity_id = { + type = "string"; + description = "entity_id"; + }; + }; + + required = ["entity_id"]; + }; + }; + + function = { + type = "template"; + value_template = "{{ states[entity_id] }}"; + }; + } + { spec = { name = "timer_start";