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

Crash over ZeroDivisionError #1048

Closed
azukaar opened this issue Sep 25, 2024 · 7 comments
Closed

Crash over ZeroDivisionError #1048

azukaar opened this issue Sep 25, 2024 · 7 comments

Comments

@azukaar
Copy link

azukaar commented Sep 25, 2024

Issue does not already exist?

No, I did not search

Select Environment

Docker

Home Assistant related?

Yes

Description

The hue bridge is very slow to "wake up" - if I dont access it for a while, the mobile app will take a minute to actually connect. At first I thought it was because of #1043 (which you have fixed, thanks again!) but it did not solve the issue and there is now another crash in the log which hopefully is related.

Errorlog:

[2024-09-25 17:15:33,352] ERROR in app: Exception on /clip/v2/resource [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/v2restapi.py", line 290, in get
    data.append(group.getV2GroupedLight())
  File "/opt/hue-emulator/HueObjects/Group.py", line 296, in getV2GroupedLight
    result["dimming"] = {"brightness": self.update_state()["avr_bri"]}
  File "/opt/hue-emulator/HueObjects/Group.py", line 142, in update_state
    bri = (((bri/lights_on)/254)*100)
ZeroDivisionError: division by zero

Steps to reproduce

Please enter your operating system details here

Hue-Emulator Version: 2024-09-21 14:00:03.000000000
WebUI Version: 2024-09-21 14:00:04.000000000
Architecture: aarch64
OS: Linux
Linux version: #1 SMP PREEMPT Tue Jun 18 13:49:00 UTC 2024
Linux release: 6.6.33-haos
Hardware: %Hardware%

Upload debug tar

Debug.zip

What DiyHue version(branch) are you using?

master (latest)

@hendriksen-mark
Copy link
Member

Hi, it is strange that with 0 brightness the light is still on?
i made a change to fix this.
please update and give feedback.

@azukaar
Copy link
Author

azukaar commented Sep 26, 2024

CI failed for ARM sorry havent been able to update

@hendriksen-mark
Copy link
Member

hendriksen-mark commented Sep 26, 2024

Yes there were some deprecated stuff. This one is succes https://github.com/diyhue/diyHue/actions/runs/11039805818

GitHub
Main diyHue software repo. Contribute to diyhue/diyHue development by creating an account on GitHub.

@azukaar
Copy link
Author

azukaar commented Sep 26, 2024

Does that include all the docker images? It's weird my home assistant does not see this update
image

@hendriksen-mark
Copy link
Member

HA does not follow the main repo. To push a update to HA we have to do it separately. When im home i will make a update to HA addon

@azukaar
Copy link
Author

azukaar commented Sep 26, 2024

Ah makes sense, thanks a bunch!

hendriksen-mark added a commit to diyhue/hassio-addon that referenced this issue Sep 26, 2024
@azukaar
Copy link
Author

azukaar commented Oct 1, 2024

It works perfectly now, thanks you!

@azukaar azukaar closed this as completed Oct 1, 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

2 participants