raetha / wyzesense2mqtt

Configurable WyzeSense to MQTT Gateway intended for use with Home Assistant or other platforms that use MQTT discovery mechanisms.
MIT License
79 stars 22 forks source link

Add option to publish sensor name in MQTT payload #26

Closed dale3h closed 4 years ago

dale3h commented 4 years ago

This PR implements the feature mentioned in #25, but with the ability to enable/disable via config.yaml. The feature defaults to being disabled, but can be enabled by setting publish_sensor_name: true in config.yaml.

A failsafe was included to prevent errors if publish_sensor_name is not defined in config.yaml (for example: an upgrade that maintains the previous configuration).

Credit to @dennyfmn for this feature.

dale3h commented 4 years ago

@raetha I will certainly take a stab at those tweaks. I am always looking for ways to improve my knowledge and experience in Python, so I greatly appreciate the opportunity!

raetha commented 4 years ago

@dale3h, I made some changes in the underlying config and folder structure that made this a manual merge, so I just merged what you already had done so it wasn't lost. You'll need to resync with devel at some point to get everything caught up.

No worries on this either, but if I get a chance, I'm going to make the other changes I suggested tonight. Hoping to finalize testing on 1.1 over the next couple days and then release. Quite a few things in here that folks have asked for and I'd like to get them available to all. :)

raetha commented 4 years ago

Managed to fit in the tweaks. Though now that I think about it, with tweak 2, there actually isn't a need for the config option. So we might be able to clean that out eventually.