Comments (8)
Seems like the install failed for some reason. Can you run it from the command line?
I would suggest a manual pip uninstall and re-install. Let me know if it works.
from appdaemon.
I did the pip uninstall and re-install, that didn't help. Then I did a pip uninstall and deleted the appdaemon directory under the hass user. I then did an install of appdaemon, copied my appdaemon.cfg file back from last nights backup and if I specify where the cfg file is, it will start, but now I get the following errors on everything that tries to start.
2017-01-29 14:41:53.087500 WARNING ------------------------------------------------------------
2017-01-29 14:41:54.156731 WARNING ------------------------------------------------------------
2017-01-29 14:41:54.157996 WARNING Unexpected error during loading of calalarm:
2017-01-29 14:41:54.158658 WARNING ------------------------------------------------------------
2017-01-29 14:41:54.159657 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 730, in readApp
init_object(name, class_name, module_name, config[name])
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 516, in init_object
conf.objects[name]["object"].initialize()
File "/home/hass/code/appdaemon/calalarm/calalarm.py", line 82, in initialize
self.schedulealarm(room)
File "/home/hass/code/appdaemon/calalarm/calalarm.py", line 196, in schedulealarm
self.addalarm(room,m)
File "/home/hass/code/appdaemon/calalarm/calalarm.py", line 137, in addalarm
self.log("Adding alarm")
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appapi.py", line 57, in log
msg = self._sub_stack(msg)
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appapi.py", line 40, in _sub_stack
msg = msg.replace("__module__", stack[2].filename)
AttributeError: 'tuple' object has no attribute 'filename'
2017-01-29 14:41:54.160226 WARNING ------------------------------------------------------------
2017-01-29 14:41:54.268588 WARNING ------------------------------------------------------------
2017-01-29 14:41:54.269175 WARNING Unexpected error during loading of speak:
2017-01-29 14:41:54.269596 WARNING ------------------------------------------------------------
2017-01-29 14:41:54.270506 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 730, in readApp
init_object(name, class_name, module_name, config[name])
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 516, in init_object
conf.objects[name]["object"].initialize()
File "/home/hass/code/appdaemon/speak/speak.py", line 44, in initialize
self.log("using device {} for my voice".format(self.device))
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appapi.py", line 57, in log
msg = self._sub_stack(msg)
File "/usr/local/lib/python3.4/dist-packages/appdaemon/appapi.py", line 40, in _sub_stack
msg = msg.replace("__module__", stack[2].filename)
AttributeError: 'tuple' object has no attribute 'filename'
Appdaemon is installed under the hass user's home directory. That is to say the appdaemon cfg path is
/home/hass/appdaemon/conf/appdaemon.cfg
from appdaemon.
Found it. stack is not a dictionary, it's a list so you have to specify the element in the list, and you were looking at the first level 1 which was always log since you added a second function to do the replace. You needed to go back 2 levels to get to the correct data. The below seems to work.
def _sub_stack(self, msg):
stack = inspect.stack()
msg = msg.replace("module", stack[2][1])
msg = msg.replace("line", str(stack[2][2]))
msg = msg.replace("function", stack[2][3])
return(msg)
from appdaemon.
I'll take a look but it worked fine when I tested it - what version of python are you using? I think this changed at some point in the recent past.
from appdaemon.
pi@hass:~ $ python3 -V
Python 3.4.2
upgrading to latest RPI patches now
from appdaemon.
latest RPI patches and no difference, still blows up.
from appdaemon.
Released 1.5.1 to temporarily disable this functionality so it will at least start. I'll revisit when I have some more time.
from appdaemon.
Functionality restored in 1.5.2 and it shouldn't break anything this time. Your variation works in 3.5 as well as 3.4 so I adopted it - thanks! Also, as an abundance of caution, I recoded it so that if there is an issue with earlier versions of Python, it will break only of the substitution strings are actually used meaning people can fix any potential issue by not using the feature rather than it breaking for everyone.
from appdaemon.
Related Issues (20)
- Documentation to point to new configuration location HOT 5
- Weirt example in `Choosing a Start Time`
- Issue logging DEBUG level log entries HOT 2
- Add support for service calls that return data such as todo/get_items HOT 3
- Logging (self.log) does not properly handle encoding of some non-English characters. HOT 1
- Schedy App/script not working after update Appdaemon add-on to 0.15.2
- Add ability to trigger a manual check_app_update or to set a custom interval (or: is utility_delay safe to change?)
- Throw an error / refuse to load if apps.yaml has a duplicate top-level key HOT 2
- Double reset_timer set execution time to first time set
- Python 3.12 support HOT 4
- Python package imports - "expert mode" HOT 1
- Warning about "secrtets" from apps where yaml is commented out
- listen_log never receives DEBUG messages HOT 1
- get_history error - takes one positional arguement but 2 were given HOT 2
- Secrets are viewable in plaintext in AppDaemon dashboard via app arguments HOT 1
- appdaemon:dev container stop to work after today update HOT 3
- mqtt retained messages not send to app on appdaemon startup HOT 1
- Support `silent` in `cancel_listen_state` HOT 2
- Cannot call service that returns a response
- Some apps not reloaded after HA restart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appdaemon.