Skip to content

Commit

Permalink
Troubleshooting pin setup with Pi5 compat.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Mar 29, 2024
1 parent f8bc623 commit 305cd22
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions neon_phal_plugin_switches/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def validate(_=None):


class SwitchInputs(PHALPlugin):
Device.pin_factory = NativeFactory()
validator = SwitchValidator

def __init__(self, bus=None, config=None):
Expand Down Expand Up @@ -147,17 +146,19 @@ def setup_gpio(self, active_state: bool = True):
@param active_state: If true, switches are active when high
"""

act = Button(self.action_pin, pull_up=None, active_state=active_state)
act = Button(self.action_pin, pull_up=None, active_state=active_state,
pin_factory=NativeFactory)
act.when_activated = self.on_action
vol_up = Button(self.vol_up_pin, pull_up=None,
active_state=active_state)
active_state=active_state, pin_factory=NativeFactory)
vol_up.when_activated = self.on_vol_up
vol_down = Button(self.vol_dn_pin, pull_up=None,
active_state=active_state)
active_state=active_state, pin_factory=NativeFactory)
vol_down.when_activated = self.on_vol_down

self.mute_switch = Button(self.mute_pin, pull_up=None,
active_state=bool(self._muted))
active_state=bool(self._muted),
pin_factory=NativeFactory)

self.mute_switch.when_deactivated = self.on_unmute
self.mute_switch.when_activated = self.on_mute
Expand Down

0 comments on commit 305cd22

Please sign in to comment.