Skip to content

Commit

Permalink
Fixing default base_topic to misensor based on implementation
Browse files Browse the repository at this point in the history
Hey, thanks for your great work - I have started using this branch and I very much like it.
However I would like propose update of config.ini.dist:

In config.ini.dist there is the following information:

# The MQTT base topic to publish all Mi Flora sensor data topics under.
# Default depends on the configured reporting_method
#base_topic = miflora                   # Default for: mqtt-json, mqtt-smarthome
#base_topic = homie                     # Default for: mqtt-homie
#base_topic = homeassistant             # Default for: homeassistant-mqtt
#base_topic = v1/devices/me/telemetry   # Default for: thingsboard-json
#base_topic =                           # Default for: wirenboard-mqtt

So as log as I use mqtt-json the default toppic should be miflora.

While the default toppic is no longer **miflora** but **misensor** - what makes total sense cause we no longer use only miflora sensors - also it was already implemented in miflora-mqtt-daemon.py:

if reporting_mode == 'mqtt-homie':
    default_base_topic = 'homie'
elif reporting_mode == 'homeassistant-mqtt':
    default_base_topic = 'homeassistant'
elif reporting_mode == 'thingsboard-json':
    default_base_topic = 'v1/devices/me/telemetry'
elif reporting_mode == 'wirenboard-mqtt':
    default_base_topic = ''
else:
    default_base_topic = 'misensor'

Hope you dont mind my changes
  • Loading branch information
wojciej committed Feb 19, 2019
1 parent ea30653 commit f4ddf84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.ini.dist
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

# The MQTT base topic to publish all Mi Flora sensor data topics under.
# Default depends on the configured reporting_method
#base_topic = miflora # Default for: mqtt-json, mqtt-smarthome
#base_topic = misensor # Default for: mqtt-json, mqtt-smarthome
#base_topic = homie # Default for: mqtt-homie
#base_topic = homeassistant # Default for: homeassistant-mqtt
#base_topic = v1/devices/me/telemetry # Default for: thingsboard-json
Expand Down Expand Up @@ -90,4 +90,4 @@

[MiTempBt]

# Add your Mi Temerature & Humidity sensors here. Setup is same as for [MiFlora] section
# Add your Mi Temerature & Humidity sensors here. Setup is same as for [MiFlora] section

0 comments on commit f4ddf84

Please sign in to comment.