Skip to content

Commit

Permalink
Remove wallpaper_rotation session data that is handled in Qt already
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jun 12, 2024
1 parent 6c1e1f2 commit 5b6a000
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions ovos_gui_plugin_shell_companion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ def register_bus_events(self):
self.gui.register_handler("mycroft.device.settings.factory", self.handle_device_display_factory)

# Display settings
self.gui.register_handler("speaker.extension.display.set.wallpaper.rotation",
self.handle_display_wallpaper_rotation_config_set)
self.gui.register_handler("speaker.extension.display.set.auto.dim",
self.handle_display_auto_dim_config_set)
self.gui.register_handler("speaker.extension.display.set.auto.nightmode",
Expand Down Expand Up @@ -146,10 +144,7 @@ def handle_device_display_factory(self, message):
def handle_device_display_settings(self, message):
LOG.debug(f"Display settings: {self.local_display_config}")
self.gui['state'] = 'settings/display_settings'

# TODO: Refactor below to query PHAL plugin
self.gui['display_wallpaper_rotation'] = self.local_display_config.get("wallpaper_rotation", False)

# wallpaper_rotation data is determined via Messagebus in Qt directly
self.gui['display_auto_dim'] = self.local_display_config.get("auto_dim", False)
self.gui['display_auto_nightmode'] = self.local_display_config.get("auto_nightmode", False)
self.gui.show_page("SYSTEM_AdditionalSettings.qml", override_idle=True)
Expand All @@ -162,16 +157,6 @@ def handle_device_about_page(self, message):
self.gui['system_info'] = system_information
self.gui.show_page("SYSTEM_AdditionalSettings.qml", override_idle=True)

def handle_display_wallpaper_rotation_config_set(self, message: GUIMessage):
"""
Handle a GUI event requesting a new wallpaper rotation setting
@param message: `speaker.extension.display.set.wallpaper.rotation`
"""
# TODO: This should come from the PHAL plugin, not a separate config
wallpaper_rotation = message.data.get("wallpaper_rotation", False)
self.local_display_config["wallpaper_rotation"] = wallpaper_rotation
self.local_display_config.store()

def handle_display_auto_dim_config_set(self, message):
auto_dim = message.data.get("auto_dim", False)
self.local_display_config["auto_dim"] = auto_dim
Expand Down

0 comments on commit 5b6a000

Please sign in to comment.