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

Crashes after selecting bridge #33

Open
diadras opened this issue Jan 10, 2019 · 8 comments
Open

Crashes after selecting bridge #33

diadras opened this issue Jan 10, 2019 · 8 comments

Comments

@diadras
Copy link

diadras commented Jan 10, 2019

The first time the application ran I selected my bridge and hit next. I then saw the "press bridge button" picture and pressed the button on my bridge. Immediately after I did this all my lights switched off and the application had crashed.
Now when I start Luminance again I can select my bridge. Then if I press "next" the application crashes with the message:

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/luminance/application.py", line 133, in _setup_finished
self._init()
File "/usr/lib/python3.6/site-packages/luminance/application.py", line 114, in _init
application=self
File "/usr/lib/python3.6/site-packages/luminance/views/window.py", line 42, in init
self.groups_page.add(Groups(self.bridge))
File "/usr/lib/python3.6/site-packages/luminance/views/groups.py", line 32, in init
self.groups_list.add(ListBoxRow(group))
File "/usr/lib/python3.6/site-packages/luminance/views/entity.py", line 69, in init
self.brightness_scale.set_value(self.model.brightness)
File "/usr/local/lib/python3.6/dist-packages/phue.py", line 185, in brightness
self._brightness = self._get('bri')
File "/usr/local/lib/python3.6/dist-packages/phue.py", line 484, in _get
return self.bridge.get_group(self.group_id, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/phue.py", line 1069, in get_group
return self.request('GET', '/api/' + self.username + '/groups/' + str(group_id))['action'][parameter]
KeyError: 'bri'

@PanderMusubi
Copy link

Note that phue has a new release, please see https://pypi.org/project/phue/#history

@stellarpower
Copy link

I'm on phue 1.1 and this error is still occuring. I've uninstalled and reinstalled and now I see no GUI but I get a terminal mesage saying Failed to register: timeout was reached.

@PanderMusubi
Copy link

You will need to do some manual fixes, see the issues.

@lavacano
Copy link

lavacano commented Mar 24, 2020

Is this the same issue?

$ luminance

(luminance:57988): Gtk-WARNING **: 21:10:06.281: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(luminance:57988): Gtk-WARNING **: 21:10:06.281: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(luminance:57988): Gtk-WARNING **: 21:10:06.281: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/luminance/application.py", line 133, in _setup_finished
    self._init()
  File "/usr/lib/python3.8/site-packages/luminance/application.py", line 112, in _init
    self.window = Window(
  File "/usr/lib/python3.8/site-packages/luminance/views/window.py", line 42, in __init__
    self.groups_page.add(Groups(self.bridge))
  File "/usr/lib/python3.8/site-packages/luminance/views/groups.py", line 32, in __init__
    self.groups_list.add(ListBoxRow(group))
  File "/usr/lib/python3.8/site-packages/luminance/views/entity.py", line 69, in __init__
    self.brightness_scale.set_value(self.model.brightness)
  File "/usr/lib/python3.8/site-packages/phue.py", line 194, in brightness
    self._brightness = self._get('bri')
  File "/usr/lib/python3.8/site-packages/phue.py", line 484, in _get
    return self.bridge.get_group(self.group_id, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/phue.py", line 1059, in get_group
    return self.request('GET', '/api/' + self.username + '/groups/' + str(group_id))['action'][parameter]
KeyError: 'bri'

I've read through the phue issues it is installed from git. I cant figure it out, do you have a direct link?

@PanderMusubi
Copy link

Also after sudo pip3 install -U phue? See also #30

@tatoosh
Copy link

tatoosh commented May 24, 2020

Same problem here on manjaro linux with phue 1.1 - crashing after selecting my brige.

luminance

(luminance:6391): Gtk-WARNING **: 21:20:37.543: Locale not supported by C library.
	Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/phue.py", line 843, in get_light
    return state['state'][parameter]
KeyError: 'bri'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/luminance/application.py", line 133, in _setup_finished
    self._init()
  File "/usr/lib/python3.8/site-packages/luminance/application.py", line 112, in _init
    self.window = Window(
  File "/usr/lib/python3.8/site-packages/luminance/views/window.py", line 39, in __init__
    self.lights_page.add(FramedEntityList(self.bridge.get_light_objects('id').values()))
  File "/usr/lib/python3.8/site-packages/luminance/views/entity.py", line 27, in __init__
    self.list.add(ListBoxRow(entity))
  File "/usr/lib/python3.8/site-packages/luminance/views/entity.py", line 69, in __init__
    self.brightness_scale.set_value(self.model.brightness)
  File "/usr/lib/python3.8/site-packages/phue.py", line 194, in brightness
    self._brightness = self._get('bri')
  File "/usr/lib/python3.8/site-packages/phue.py", line 117, in _get
    return self.bridge.get_light(self.light_id, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/phue.py", line 845, in get_light
    raise KeyError(
KeyError: 'Not a valid key, parameter bri is not associated with light 5)'

@florianorineveu
Copy link

Up ? Same problem on my manjaro, with phue1.1...

@PanderMusubi
Copy link

Note to self for future reference, also apply this patch

diff --git a/luminance/views/entity.py b/luminance/views/entity.py
index e65dda9..06956a0 100644
--- a/luminance/views/entity.py
+++ b/luminance/views/entity.py
@@ -57,16 +57,37 @@ class ListBoxRow(Gtk.ListBoxRow):
         self.color_chooser = builder.get_object('color-chooser')
 
         if self.model.on:
-            self.color_chooser.set_rgba(
-                hsv_to_gdk_rgb(
-                    self.model.hue,
-                    self.model.saturation,
-                    self.model.brightness
+            try:
+                self.color_chooser.set_rgba(
+                    hsv_to_gdk_rgb(
+                        self.model.hue,
+                        self.model.saturation,
+                        self.model.brightness
+                    )
                 )
-            )
+            except KeyError:
+                try:
+                    self.color_chooser.set_rgba(
+                        hsv_to_gdk_rgb(
+                            0,
+                            0,
+                            self.model.brightness
+                        )
+                    )
+                except KeyError:
+                    self.color_chooser.set_rgba(
+                        hsv_to_gdk_rgb(
+                            0,
+                            0,
+                            0
+                        )
+                    )
 
         self.brightness_scale = builder.get_object('brightness-scale')
-        self.brightness_scale.set_value(self.model.brightness)
+        try:
+            self.brightness_scale.set_value(self.model.brightness)
+        except KeyError:
+            self.brightness_scale.set_value(0)
 
         self.color_chooser_popover_button = builder.get_object('color-chooser-popover-button')

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

6 participants