Should I rewrite my apps to use self.entity.function() instead of relying on self.function()?

Hi,

I have been using appdaemon for a few years, but haven’t really written any new automations.
I just noticed in the docs, that entities are a much more prominent thing than before.

Example:

The old doc looked something like this (from memory)

listen_state_handle = self.listen_state(self.callback, self.entity,...)

Now it looks like this:

listen_state_handle = self.entity.listen_state(self.callback,...)

Notice how the entity became its own object.

Should I change all my automations to this new syntax? Is there a plan to deprecate the old syntax?

Thanks!

Entirely your choice - I won’t be deprecating anything :slight_smile:

Especially considering most of my code still does it the original way!

1 Like

Good to hear, thank you! :slight_smile: