Repository navigation
Read digital inputs from the web interface - #57
Merged
Merged
Conversation
The inputs page shows inputs configured as digital as AUS/EIN instead of a value with unit, which the analog regex skipped, so they were missing when fetching via the web interface. Match them too and report them like the direct connection does: as analog inputs with value 0 or 1 and type digital. Supersedes #46, which matched them on the outputs page and with a regex that required the state twice. The test page is from the BL-NET of the user who reported it there.
A UVR1611 on CAN sends digital inputs over the direct port with type bits 000 and the state in bit 0 (recorded dataset in pyblnet-async), so the parser reports them as None like unused inputs. With both connections enabled that None replaced the state read from the web interface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #39. Supersedes #46.
Inputs configured as digital show up on the inputs page
580500.htmasAUS/EINinstead of a value with unit:The analog regex skipped them, so they were missing when fetching via the web interface.
#46 couldn't find them: it matched on the outputs page
580600.htm(viaread_digital_values), and its regex(AUS|EIN|ON|OFF){2,3}only matches the state repeated (AUSAUS).This PR
read_analog_values, in one regex with the other inputs so the order stays as on the pageanalogentries with value"0"/"1",unit_of_measurement: Noneandtype: "digital"(not indigital, which holds the outputs and would collide by id)The new tests fail on master and pass here.
Second commit: with web and direct enabled, a
Nonefrom the direct connection no longer replaces the web value. A UVR1611 on CAN sends digital inputs as type 000 with the state in bit 0 (see the recorded CAN dataset in pyblnet-async, input 2 =0x0001), which the parser reports asNonesince #49. In direct-only mode those inputs remain indistinguishable from unused ones.