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 1ba5334 commit 76dc997
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 3 additions & 3 deletions backend/lib/Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ class Configuration {
if (parsedConfig._version !== Tools.GET_NoCloud_VERSION()) {
Logger.info(`Migrating config from ${parsedConfig._version} to ${Tools.GET_NoCloud_VERSION()}`);

// BEGIN migration code to be removed with the next version
if (parsedConfig.ntpClient.server === "pool.ntp.org") {
// BEGIN code for Valetudo to NoCloud migration - NTP configuration
if (parsedConfig.ntpClient.server === "valetudo.ntp.org") {
parsedConfig.ntpClient.server = "pool.ntp.org"; // NoCloud sticks to the global one
}
// END migration code to be removed with the next version
// END code for Valetudo to NoCloud migration - NTP configuration

parsedConfig._version = Tools.GET_NoCloud_VERSION();
}
Expand Down
5 changes: 0 additions & 5 deletions backend/lib/doc/Configuration.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,12 @@
"additionalProperties": false,
"required": [
"enabled",
"addICBINVMapProperty",
"cleanAttributesOnShutdown"
],
"properties": {
"enabled": {
"type": "boolean"
},
"addICBINVMapProperty": {
"type": "boolean",
"description": "If true, adds Homie definitions for ICBINV's PNG map topic as that's not possible to add in ICBINV itself."
},
"cleanAttributesOnShutdown": {
"type": "boolean"
}
Expand Down
8 changes: 4 additions & 4 deletions backend/lib/mqtt/MqttController.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ class MqttController {
return this.client && this.client.connected === true && this.client.disconnecting !== true;
}

/**
/**
* Set device state
*
* @private
Expand Down Expand Up @@ -666,9 +666,10 @@ class MqttController {
// we must never exit reconfigure in the READY state if we are in fact not READY
if (reconfOptions.targetState === HomieCommonAttributes.STATE.READY && !this.isConnected) {
Logger.debug(`Overriding reconfigure target state '${reconfOptions.targetState}' with '${previousState}' since we're not connected.`);

reconfOptions.targetState = previousState;
}

await this.setState(reconfOptions.targetState);

this.mutexes.reconfigure.leave();
Expand Down Expand Up @@ -979,12 +980,11 @@ module.exports = MqttController;
*
* @property {object} interfaces.homie
* @property {boolean} interfaces.homie.enabled
* @property {boolean} interfaces.homie.addICBINVMapProperty
* @property {boolean} interfaces.homie.cleanAttributesOnShutdown
*
* @property {object} interfaces.homeassistant
* @property {boolean} interfaces.homeassistant.enabled
* @property {boolean} interfaces.homeassistant.cleanAutoconfOnShutdown
*
* @property {Array<string>} optionalExposedCapabilities
*/
*/

0 comments on commit 76dc997

Please sign in to comment.