Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'OccuSim' object has no attribute 'turn_on' #11

Closed
shlomki opened this issue Feb 9, 2018 · 3 comments
Closed

AttributeError: 'OccuSim' object has no attribute 'turn_on' #11

shlomki opened this issue Feb 9, 2018 · 3 comments

Comments

@shlomki
Copy link

shlomki commented Feb 9, 2018

Hi!
I'm trying to use OccuSim for the first time.
I'm running AppDaemon version 3.0.0b2 and OccuSim version 1.1.5.
It looks like I got everything configured and running properly, but when a step is fired, an error is written to the log:

2018-02-09 21:53:42.002532 WARNING AppDaemon: ------------------------------------------------------------
2018-02-09 21:53:42.002532 WARNING AppDaemon: Unexpected error in worker for App Occupancy Simulator:
2018-02-09 21:53:42.002532 WARNING AppDaemon: Worker Ags: {'id': UUID('6a85611c-1d3e-47dc-a03c-1f5781221e4d'), 'type': 'timer', 'kwargs': {'step': 'Evening Office_on_137', 'random_office_on_1': 'switch.lr_dining_table_light', 'constrain_input_boolean': 'input_boolean.not_at_home,on'}, 'name': 'Occupancy Simulator', 'function': <bound method OccuSim.execute_step of <occusim.OccuSim object at 0x0000014BE9A2C7F0>>}
2018-02-09 21:53:42.002532 WARNING AppDaemon: ------------------------------------------------------------
2018-02-09 21:53:42.002532 WARNING AppDaemon: Traceback (most recent call last):
File "c:\users\shlomi\appdata\local\programs\python\python35\lib\site-packages\appdaemon\appdaemon.py", line 506, in worker
funcref(self.sanitize_timer_kwargs(app, args["kwargs"]))
File "config\appdaemon\apps\occusim.py", line 220, in execute_step
self.activate(kwargs[arg], "on")
File "config\appdaemon\apps\occusim.py", line 238, in activate
if not self.test: self.turn_on(entity)
AttributeError: 'OccuSim' object has no attribute 'turn_on'

2018-02-09 21:53:42.002532 WARNING AppDaemon: ------------------------------------------------------------

Any ideas?

@brightdroid
Copy link

Until occusim is updated to the new appdaemon/hass api you can modify the following lines:

#import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass

#...

class OccuSim(hass.Hass):

@acockburn
Copy link
Owner

Thanks @brightdroid - correct.

Since AD 3.0 is still in Beta I haven;t changed OccuSim to match yet.

@shlomki
Copy link
Author

shlomki commented Feb 9, 2018

Thanks for the quick reply! Seems to have worked :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants