Skip to content

deprecated state.get_attr() doesn't work in 1.0.0 #92

Closed
@tal

Description

@tal

When I updated to the latest version my code like this attrs = state.getattr(entity_id) is no longer returning a dictionary that can respond to the get() method.

After a none check I'd previously use the following code:

current_brightness = attrs.get("brightness", 0)

Now i have to do

starting_brightness = 0
if "brightness" in attrs:
  starting_brightness = attrs["brightness"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions