miracle2k / onkyo-eiscp

Control Onkyo A/V receivers over the network; usuable as a script, or as a Python library.
MIT License
466 stars 110 forks source link

Fix checking if command is RAW #126

Closed davidspek closed 3 years ago

davidspek commented 3 years ago

Originally, a command was determined to be raw if it was all uppercase and only alphanumerical. This breaks any command that contains a different character such as setting the temporary subwoofer level with SWL+05. A regular expression now checks if a command is all uppercase, contains - or +, and if it is alphanumerical. To achieve support for True/False, the entire string is checked using ^ and $. Thus, a command will be seen as raw if it starts with 1 or more uppercase letters, contains 0 or more - or + and ends with 0 or more numbers or uppercase letters in any combination.