hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
160 stars 49 forks source link

Person state continuous trigger. #188

Closed josephkiser04 closed 2 years ago

josephkiser04 commented 2 years ago

Problem/Motivation

Latest release of v0.8.0 has an issue with the listen_state on person entities.

Expected behavior

The listen state should behave as any other listen_state call.

Actual behavior

When you listen for a state change on a person entity the state change gets repeatedly called.

Steps to reproduce

set up a listen state call on a person and call to a method that includes a log print. The log with get called over and over with no state changes happening from the person. A simple example is this:

class TestRoutine(hass.Hass):
    def initialize(self):
        self.listen_state(self.test_routine_cb, 'person.person')

    def test_routine_cb(self, *kwargs):
        # Print to log.
        self.log('I am here!')
frenck commented 2 years ago

The main state may be unchanged, the state attributes probably did change.

Please note that listening to a state change entails the whole state, including it's attributes.

This is not a bug, but how Home Assistant works.

josephkiser04 commented 2 years ago

Something here is different. I only say that because I have had an automation that uses this listen state for more then two years in a presence detection system with no issues. And it's even currently running correctly in version 0.7.2 as soon as I update to 0.8.0 the call goes haywire with no code changes.

frenck commented 2 years ago

@josephkiser04 That would be a change with AppDaemon itself, not the add-on. The add-on isn't providing or changing that logic that is defined from upstream AppDaemon.

I guess this issue, in that case, isn't in the right issues tracker?

josephkiser04 commented 2 years ago

@frenck omg you are absolutely right I do apologize for bugging you lol! I will open an issue over there. Thanks!