Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analog inputs and add sensors, digital inputs, and analog inputs to configuration #24

Merged
merged 10 commits into from
Nov 30, 2023

Conversation

dboulware
Copy link
Contributor

This adds the ability to read analog inputs from the controlbyweb web relays. In addition, this allows users to map sensors, digital inputs and analog inputs into to the configuration. Any sensors, digital inputs, and analog inputs will be provided in calls to get_status.

Copy link
Member

@aromanielloNTIA aromanielloNTIA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See feedback below

},
"digital_inputs": {
"ups_power": 1,
"ups_battery_level": 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend changing "ups_battery_level" to a better descriptor like "ups_battery_low"

Also update the example in the README for any change made.

README.md Show resolved Hide resolved
config/config.json Show resolved Hide resolved
src/its_preselector/controlbyweb_web_relay.py Outdated Show resolved Hide resolved
src/its_preselector/controlbyweb_web_relay.py Outdated Show resolved Hide resolved
README.md Outdated
@@ -88,6 +107,11 @@ those specified in the mapping. Each of the entries in the config provide mappin
associated web relay input states and every RFPath defined in the sensor definition json
file should have an entry in the preselector config. The keys in the dictionary may use the
name of the RFPath or the index of the RFPath in the RFPaths array.
The `sensors`, `digital_inputs`, and `analog_inputs` keys define the sensors,
digital_inputs and analog_inputs configured on the device. Within each of the sections,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend checking this paragraph for consistent usage of monospace formatting

src/its_preselector/controlbyweb_web_relay.py Show resolved Hide resolved
src/its_preselector/web_relay.py Outdated Show resolved Hide resolved
tests/test_controlbyweb_web_relay.py Show resolved Hide resolved
… inputs. Add tests for get_sensor_value and get_digital_input_value. Correct type hint. Update readme.
Copy link
Member

@aromanielloNTIA aromanielloNTIA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@dboulware dboulware merged commit 977c4e4 into master Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants