ble-pasv-mqtt-gw overhaul #158
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ble pasv mqtt gw overhaul
This PR introduces several changes, including fixes, refactors, and new features. All are focused on Discovery while BLE code remains untouched (almost... support of multi-button devices has required some touches)
Major changes:
New features
connections
,identifiers
, andvia_device
to the MQTT discovered deviceImprovements
Breaking changes:
The data are no longer stored in
sensor
,telemetry
, andstatus
topics. The new common topic isdata
.Click for details
There are multiple reasons for that:It turns out that depending on the combination of values in the event, particular values might got their topic changed as time goes by.
Changed naming schema
mac-model
ormac
if the model is not providedtemperature
. Then HA will create entity_id based onmac-model devclass
, for example (sensor.xxxxxxxxx_ht_temperature
)unique_id
of entities is set tomac-type
(xxxxxxxxx-window
) ormac-type-index
(xxxxxxxxxxx-button-2
)Click for details
Change to the naming aligns final device and entity names with Home Assistant standards.HA will name the entity to
devicename name
, for example:1a2b3c4d5e6f-H&T BLU Temperature
. Then, renaming the device gives an option to automatically rename entities in order to follow the device name change. For example, changing the name of the device toPCROOM HT
will (after confirmation) turn the entity name intoPCROOM HT Temperature
.On top of that, some HA pages (ie, device view) can strip the device name out of the entity name, making them shorter and less cluttered.