-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
Add MQTT gateway for MySensors #2960
Add MQTT gateway for MySensors #2960
Conversation
* Use mqtt component to enable a MySensors MQTT gateway. * Setup the MQTT gateway if mysensors config has mqtt as a value for the key device in the list of gateways. * Simplify two lines in the mqtt component.
@MartinHjelmare out of interest, does this include support for the MySensors API 2.0 i.e the new / deprecated variables as per their dev doc? |
if device in 'mqtt': | ||
if not setup_component(hass, 'mqtt', config): | ||
return | ||
mqtt = get_component('mqtt') |
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.
Maybe use constant for 'mqtt'
?
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.
This is actually the more appropriate way as it allows people to overwrite the built-in mqtt component
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.
I think @turbokongen means that I should extract mqtt
into a constant, ie
MQTT_COMPONENT = 'mqtt'
I think that doesn't hurt right?
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.
@MartinHjelmare you got it right 👍
@omgapuppy No, we need to add the new S and V_TYPES to the appropriate sensor platforms in home assistant. That's another PR. All new types are already supported in the pymysensors library. So it's just a matter of sorting them into the correct platform, that makes sense. Help is welcome. |
@MartinHjelmare I'll give it a try today to map the new types to the appropriate platform. Ok if I work against your fork of HA? |
@Landrash That would be awesome! Yes, you can work against my fork. Should I create a new branch there, so you can do a PR to that? |
@MartinHjelmare Yes, sounds like a plan! |
I've pushed a new branch to my fork based off dev branch: Let me know if you want me to do something else. |
This should be good for merging now. |
Description:
the key device in the list of gateways.
I will add voluptuous config validation in a separate PR, after this is merged.
Pull request in home-assistant.io with documentation (if applicable):
home-assistant/home-assistant.io#841
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If code communicates with devices, web services, or a:
tox
run successfully. Your PR cannot be merged unless tests pass