Closed imsunburnt closed 9 months ago
Wow, quite an oversight on my part -- and the tests I added should have included something for this.
Thanks for pointing it out, and for a complete / thorough issue.
I did add it to the mqttplugin (which was initially where the need for "fake_state
" stuff came up): https://github.com/n8henrie/fauxmo-plugins/commit/485e310c99cd91dee6e23634f43250c7d062ecde and just didn't follow through here. I don't think this is needed for the HomeAssistant plugin, as hass does state reporting pretty reliably (and so I never gave it afake_state
option), but will add to commandline and simplehttp plugins.
I did add a test that might have caught this, but this code path is never taken because none of the test configs include initial_state
. SMH.
Appropriately failing tests added in 04ede8081dd16227733d0da0101f377d0c08a6f1
I read this and get the same issue with the commandlineplugin.py. Is there a fix coming for that too? Do I need to add "initial_state": "off", to my config file? Thanks.
fauxmo --version
): v0.7.0My Issue
In config.json when I include "initial_state": "off" I get the following ERROR:
WHYT
My original problem occurred when upgrading from v0.5.0 to v0.7.0 and re-using the config.json file that does not contain a value for "initial_state" (since it's v0.5.0) but does have "use_fake_state":
When I run fauxmo from the venv and I command Alexa to discover devices I get: AttributeError: 'SimpleHTTPPlugin' object has no attribute '_latest_action'
After looking at the code
plugins/__init__.py
it looks like I need to define "initial_state" in config.json, else the attribute _latest_action will not get defined. When I add a value for "initial_state" in config.json then I get the error that I wrote this issue for.Am I right for including "initial_state" in config.json or have I misunderstood how to use it?
NOTE: I added "initial_state" to
plugins/simplehttpplugin.py
and the error went away.Please make sure you've taken these steps before submitting a new issue:
-vvv
) and include relevant outputconfig.json