HomeElixir.Entities (HomeElixir v0.1.0)

View Source

Allowed states has string element to match the ones created in the entities in the client developed by the same author.

Most of the inputs are type String.

The pattern matching is done by atoms but as I have to write in the end I write strings.

One task is changing the inputs that are fixed to atoms and the outputs have to be strings.

Summary

Functions

Function entity({domain, name}, state, opts \ []) creates the base map for an entity, now the entity types are

Returns true if the given state exist, and false otherwise.

This structure contains all of the types of triggers and options that the system supports. To generate triggers, it is necessary to check if they are included inside of these trigger options.

Functions

build(entities)

Function entity({domain, name}, state, opts \ []) creates the base map for an entity, now the entity types are:

  • input_boolean: This has the header entity(domain, name, state, opts \ []) and the are unique attributes to select from, that can be checked in the documentation.

  • input_select: The header is entity({:input_select, name}, options, opts) and the difference is that the state is defined by a list of options. Also the check for the possible attributes for this entity type.

  • input_number: The header is entity({:input_number, name}, min, max, opts) and its difference in the state is that it needs the range specified by its min and max variables, it also has a unique set of attributes the user may check.

check_correct_state(domain_atom, state)

Returns true if the given state exist, and false otherwise.

entity(arg)

entity(arg1, opts)

@spec entity(
  {:input_boolean, String.t()},
  [{HomeElixir.Types.input_boolean_attributes(), String.t() | boolean()}]
) :: map()
@spec entity(
  {:input_select, String.t()},
  [String.t()]
) :: map()

entity(arg1, options, opts \\ [])

@spec entity({:input_select, String.t()}, [String.t()], [
  {HomeElixir.Types.input_select_attributes(),
   HomeElixir.Types.attribute_types()}
]) :: map()

entity(arg1, platform, code, opts)

@spec entity(
  {:alarm_control_panel, String.t()},
  HomeElixir.Types.alarm_platform(),
  String.t(),
  [HomeElixir.Types.alarm_option()]
) :: map()
@spec entity(
  {:input_number, String.t()},
  HomeElixir.Types.input_number_state(),
  HomeElixir.Types.input_number_state(),
  [
    {HomeElixir.Types.input_number_attributes(),
     HomeElixir.Types.attribute_types()}
  ]
) :: map()

trigger_options()

This structure contains all of the types of triggers and options that the system supports. To generate triggers, it is necessary to check if they are included inside of these trigger options.