Skip to content
Permalink
Browse files

validate LISY switch numbers against hardware responses

  • Loading branch information...
jabdoa2 committed Jun 16, 2019
1 parent 11bf7f2 commit b39bc2759eb83bb1160ca0b3a70247ddeb4aa7a9
Showing with 3 additions and 2 deletions.
  1. +3 −2 mpf/platforms/lisy/lisy.py
@@ -510,8 +510,9 @@ def parse_light_number_to_channels(self, number: str, subtype: str):

def configure_switch(self, number: str, config: SwitchConfig, platform_config: dict) -> SwitchPlatformInterface:
"""Configure a switch."""
if (int(number) % 10) > 7 or 0 < int(number) > 77:
raise AssertionError("Invalid switch number {}".format(number))
if number not in self._inputs:
raise AssertionError("Invalid switch number {}. Platform reports the following switches as "
"valid: {}".format(number, list(self._inputs.keys())))

return LisySwitch(config=config, number=number)

0 comments on commit b39bc27

Please sign in to comment.
You can’t perform that action at this time.