Skip to content

Commit

Permalink
feat(MQTT): Remove obsolete addICBINVMapProperty setting (master branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
DGAlexandru committed Jan 8, 2025
1 parent 76dc997 commit e91c18a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 41 deletions.
24 changes: 1 addition & 23 deletions backend/lib/mqtt/handles/MapNodeMqttHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,13 @@ class MapNodeMqttHandle extends NodeMqttHandle {
topicName: "map-data",
friendlyName: "Raw map data",
datatype: DataType.STRING,
format: "json, but deflated",
getter: async () => {
return this.getMapData(false);
}
})
);

// Add "I Can't Believe It's Not NoCloud" map property. Unlike Home Assistant, Homie autodiscovery attributes
// may not be changed by external services, so for proper autodiscovery support it needs to be provided by
// NoCloud itself. ICBINV may publish the data at any point in time.
if (this.controller.currentConfig.interfaces.homie.addICBINVMapProperty) {
this.registerChild(
new PropertyMqttHandle({
parent: this,
controller: this.controller,
topicName: "map",
friendlyName: "Map",
datatype: DataType.STRING,
getter: async () => {
/* intentional */
},
helpText: "This handle is only enabled if `interfaces.homie.addICBINVMapProperty` is enabled in the config. " +
"It does not actually provide map data, it only adds a Homie autodiscovery property so that " +
"'I Can't Believe It's Not NoCloud' can publish its map within the robot's topics and be " +
"autodetected by clients.\n\n" +
"ICBINV should be configured so that it publishes the map to this topic."
})
);
}

this.registerChild(
new PropertyMqttHandle({
parent: this,
Expand Down
1 change: 0 additions & 1 deletion backend/lib/res/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"interfaces": {
"homie": {
"enabled": true,
"addICBINVMapProperty": false,
"cleanAttributesOnShutdown": false
},
"homeassistant": {
Expand Down
1 change: 0 additions & 1 deletion backend/lib/webserver/NoCloudRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ class NoCloudRouter {
interfaces: {
homie: {
enabled: obj.interfaces.homie.enabled,
addICBINVMapProperty: obj.interfaces.homie.addICBINVMapProperty,
cleanAttributesOnShutdown: obj.interfaces.homie.cleanAttributesOnShutdown
},
homeassistant: {
Expand Down
2 changes: 1 addition & 1 deletion docs/_pages/integrations/mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ ICBINV should be configured so that it publishes the map to this topic.
*Property, readable, retained*

- Read topic: `<TOPIC PREFIX>/<IDENTIFIER>/MapData/map-data`
- Data type: [string](https://homieiot.github.io/specification/#string)
- Data type: [string](https://homieiot.github.io/specification/#string) (format: `json, but deflated`)



Expand Down
1 change: 0 additions & 1 deletion frontend/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ export interface MQTTConfiguration {
interfaces: {
homie: {
enabled: boolean;
addICBINVMapProperty: boolean;
cleanAttributesOnShutdown: boolean;
};
homeassistant: {
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/options/connectivity/MQTTConnectivityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,6 @@ const MQTTConnectivity = (): React.ReactElement => {
<FormLabel component="legend" sx={{userSelect: "none"}}>Select the options for Homie
integration</FormLabel>
<FormGroup>
<MQTTSwitch
mqttConfiguration={mqttConfiguration}
modifyMQTTConfig={modifyMQTTConfig}
title={"Provide autodiscovery for \"I Can't Believe It's Not NoCloud\" map"}
configPath={["interfaces", "homie", "addICBINVMapProperty"]}
/>
<MQTTSwitch
mqttConfiguration={mqttConfiguration}
modifyMQTTConfig={modifyMQTTConfig}
Expand Down
8 changes: 0 additions & 8 deletions util/generate_mqtt_docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ automatically discover your NoCloud instance.
<br>
</div>
## Map
Note that, in order to view the map provided over MQTT, you additionally need
[I Can't Believe It's Not NoCloud](/pages/companion_apps/i_cant_believe_its_not_NoCloud.html) to generate PNG maps.
You can then configure it to serve the PNG map over HTTP for openHAB and other software, or install the
[Lovelace NoCloud Card Map](/pages/companion_apps/lovelace_NoCloud_map_card.html) for Home Assistant.
## Custom integrations
If you're planning to use one of the home automation platforms listed above, this is all you need to know to get started.
Expand Down Expand Up @@ -683,7 +676,6 @@ class FakeMqttController extends MqttController {
"interfaces": {
"homie": {
"enabled": true,
"addICBINVMapProperty": true,
"cleanAttributesOnShutdown": false
},
"homeassistant": {
Expand Down

0 comments on commit e91c18a

Please sign in to comment.