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

Application stops working because brightness for Ikea Tradfri bulbs can be None or null #985

Closed
ziegi1982 opened this issue Jan 13, 2024 · 0 comments

Comments

@ziegi1982
Copy link

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Docker

Home Assistant related?

No

Description

App stops working because of None or null value in brightness for Ikea Tradfri bulbs.

Cast to int with NoneType throws exception.

if #961 change would be enhanced to check for None or null like #951 does, everything would work.

Errorlog:

2024-01-13 07:25:41,481 - werkzeug - INFO - 192.168.0.200 - - [13/Jan/2024 07:25:41] "GET /api/94dff570b16f11ee9e80d83addbbc5f7/lights HTTP/1.1" 500 -
[2024-01-13 07:25:42,426] ERROR in app: Exception on /api/94dff570b16f11ee9e80d83addbbc5f7/lights [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/hue-emulator/flaskUI/restful.py", line 131, in get
    response[object] = bridgeConfig[resource][object].getV1Api(
  File "/opt/hue-emulator/HueObjects/__init__.py", line 362, in getV1Api
    result["state"]["bri"] = int(self.state["bri"])
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Steps to reproduce

Install dyiHue
Use ZHA and SkyConnect to set up Ikea Tradfri Bulbs.
Start dyiHue and wait some seconds.

Please enter your operating system details here

Linux 6.1.63-haos-raspi aarch64

Home Assistant Core 2024.1.2

What DiyHue version(branch) are you using?

master (latest)

@ziegi1982 ziegi1982 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant