-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unable to power off by setting mode to 0 #25
Comments
Without testing it on my system could you try my script (which worked yesterday at HA version 0.100.2) |
Thanks for the quick response! Unfortunately, seems like it does the same thing with either single or double quotes around the 0. I'm on 0.100.3, though the change notes don't make it seem like they'd have touched anything that should be related. |
I want to update this weekend.. I will look into it then. |
Thanks again! In doing some more digging, I found that this seems to be the case any time I use a value of 0 for the DreamScreen Service's available calls. For example, calling set_brightness with a value of 0 or set_ambient_scene with a scene of 0 also both throw the "'int' object is not callable" error. Not sure if that helps at all, just something I found while coming up with a workaround of setting the brightness to 1 and color to 000001 to effectively turn the LEDs off for now. |
Tested it - works. |
Thanks for testing. I did validate that I'm on the latest for the DS4K - 1.6.5.6. At least this is the latest the app provides - not sure if there's some community unofficial firmware I'm not aware of. Is your setup using the latest pull of the DS Service as well? If so, I can't imagine why this isn't working in my setup, since I nuked my whole DS Service folder out and re-pulled to make sure I had the latest files for it. Not a huge deal, since I have a workaround in setting mode to ambient, brightness to 1, and color to 000001 as my new "off" script, which is such a low signal that the LEDs don't light up - just hoping that that isn't dangerous 24x7 for the DreamScreen. |
Last Edit 2018 - so I don't think thats it. |
Hello, I still have the error: |
Oh.. Turns out my version is pre hdr. The failing function got added in a commit later. Sent with GitHawk |
Yes thanks. Will fix soon. Will inform you here then. Sent with GitHawk |
Could you test 6529aec please? I've updated over here and it seems to work now. But I don't want to close until you can confirm. |
I tested it. I don't get the error anymore, but the service "set_mode" doesn't turn off the dreamscreen. looks like an empty service. no error message nothing |
I think i found the problem. Here is what I did.
As you can see, I've replaced the getattr() and force to setattr() in order to get back to what it was before the HDR commit and it works fine. |
Great Work! |
That fixed it on my side as well. Thanks all! |
Also fixed on my side. Great work @msalhi |
I currently have a series of HA Scripts setup to set different modes on my DreamScreen via scripts.yaml - off, video, music, and ambient. Previously, all 4 were working fine, but the SD card on my Pi died, and after rebuilding and updating HA and the HA DreamScreen Service to the latest, I'm no longer able to issue the mode: 0 to power the DreamScreen off. All other modes work fine, and the same script I use to power off works as expected to change the mode to video, music, or ambient by specifying anything but 0 for the mode.
When trying to execute the script to set the mode to 0, nothing changes on the DreamScreen, and I get this event in the HA logs:
Error executing script script.dreamscreen_off. Unknown error for call_service at pos 1:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 209, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 181, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 265, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 348, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 97, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1233, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1258, in _execute_service
await handler.func(service_call)
File "/config/custom_components/dreamscreen/init.py", line 173, in async_handle_dreamscreen_services
getattr(entity.device, attribute)()
TypeError: 'int' object is not callable
Attached is my scripts.yaml, which previously worked fine until updating HA and the script from a ~6 mo - 1 year old version.
scripts.yaml.txt
The text was updated successfully, but these errors were encountered: