Skip to content

Type definitions for getEntity()聽#27

Description

@zoe-codez

馃 Context

Feature isn't implemented yet

  const example = synapse.switch({  });
  example.getEntity().onUpdate(new_state => {
    //
  });

new_state: NonNullable<ENTITY_STATE<PICK_ENTITY<TRawDomains>>>

馃摤 Caveats

  • there isn't a straightforward way to go from entity to go from synapse entity -> hass entity in type definitions

Both suggested_object_id & unique_id are optional params, leaving name as the only guaranteed attribute. A fully automatic strategy doesn't seem viable here

馃┗ Additional details

Probably can do a manual thing, limiting by platform and domain to trim down the options

const example = synapse.switch({  });
example.getEntity<"switch.example">().onUpdate(new_state => {
  //
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions