-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
SNMP sensor #2244
SNMP sensor #2244
Conversation
Looks fine to me. |
vol.Optional(CONF_PORT): vol.Coerce(int), | ||
vol.Optional(CONF_COMMUNITY): vol.Coerce(str), | ||
vol.Required(CONF_BASEOID): vol.Coerce(str), | ||
vol.Optional('unit_of_measurement'): vol.Coerce(str), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can the user pick a unit of measurement ?
Also, we have a constant for that in homeassistant.const
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can the user pick a unit of measurement ?
Because certain nodes inside the tree are delivered without unit of measurement. Others are. Anyway, in a lot of cases it will be necessary to use a template sensor for the conversion in a more human readable form as long that the template support for this sensor is missing.
Also, we have a constant for that in
homeassistant.const
.
Thanks, was only checking CONF* and not ATTR*.
|
||
PLATFORM_SCHEMA = vol.Schema({ | ||
vol.Required(CONF_PLATFORM): 'snmp', | ||
vol.Optional(CONF_NAME): vol.Coerce(str), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, we have cv.string
that is slightly better than this.
Looks good! 🐬 |
Description:
A simple SNMP sensor.
Related issue (if applicable): fixes #
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#538
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If code communicates with devices:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass