Hypfer / ICantBelieveItsNotValetudo

A Valetudo companion service which renders maps to pngs
Apache License 2.0
129 stars 80 forks source link

Configuration is read incorrectly and rewritten wrong when starting ICantBelieveItsNotValetudo #73

Closed antlarr closed 2 years ago

antlarr commented 2 years ago

When starting ICantBelieveItsNotValetudo, the message Schema changes were applied to the configuration file at... was logged and the configuration in config.json is not used at all. Upon inspection of the changes applied to the config file, I noticed it was rewritten with the default settings and the original configuration was rewritten as a map between the character position and each character of the original config file. Leaving the config.json file like:

{
  "0": "{",
  "1": "\n",
  "2": " ",
  "3": " ",
  "4": "\"",
  "5": "m",
  "6": "a",
  "7": "p",
  "8": "S",
  "9": "e",
  "10": "t",
  "11": "t",
  "12": "i",
  "13": "n",
  "14": "g",
  "15": "s",
  "16": "\"",
  "17": ":",
  "18": " ",
  "19": "{",
  "20": "\n",
  "21": " ",
  "22": " ",
  "23": " ",
  "24": " ",
  "25": "\"",
  "26": "d",
  "27": "r",
  "28": "a",
  "29": "w",
  "30": "P",
  "31": "a",
  "32": "t",
  "33": "h",
[...]
  "700": "l",
  "701": "o",
  "702": "g",
  "703": "L",
  "704": "e",
  "705": "v",
  "706": "e",
  "707": "l",
  "708": "\"",
  "709": ":",
  "710": " ",
  "711": "\"",
  "712": "i",
  "713": "n",
  "714": "f",
  "715": "o",
  "716": "\"",
  "717": "\n",
  "718": "}",
  "mapSettings": {
    "drawPath": true,
    "drawCharger": true,
    "drawRobot": true,
    "scale": 2,
    "rotate": 0,
    "colors": {
      "floor": "#0076ff",
      "obstacle": "#52aeff",
      "path": "#ffffff"
    }
  },
  "mqtt": {
    "identifier": "rockrobo",
    "topicPrefix": "valetudo",
    "autoconfPrefix": "homeassistant",
    "broker_url": "mqtt://user:pass@foobar.example",
    "caPath": "",
    "mapDataTopic": "valetudo/robot/MapData/map-data",
    "minMillisecondsBetweenMapUpdates": 10000,
    "publishMapImage": true,
    "publishAsBase64": false
  },
  "webserver": {
    "enabled": false,
    "port": 3000
  },
  "logLevel": "info"
}