-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented non-interactive Map via MQTT
- Loading branch information
Showing
8 changed files
with
643 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,16 @@ const Configuration = function() { | |
"mqtt" : { | ||
enabled: false, | ||
identifier: "rockrobo", | ||
broker_url: "mqtt://foobar.example" | ||
broker_url: "mqtt://user:[email protected]", | ||
mapSettings: { | ||
drawPath: true, | ||
drawCharger: true, | ||
drawRobot: true, | ||
border: 2, | ||
doCropping: true, | ||
scale: 4 | ||
}, | ||
mapUpdateInterval: 30000 | ||
} | ||
}; | ||
|
||
|
@@ -24,9 +33,10 @@ const Configuration = function() { | |
try { | ||
this.settings = JSON.parse(fs.readFileSync(this.location)); | ||
} catch(e) { | ||
//TODO: handle this | ||
console.error("Invalid configuration file!"); | ||
throw e; | ||
console.log("Writing new file using defaults"); | ||
|
||
this.persist(); | ||
} | ||
} else { | ||
console.log("No configuration file present. Creating one at:", this.location); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9d44048
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mqtt png map works very well with Hass!
9d44048
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one request regarding mqtt:
Please add to configuration two types of prefixes:
first for general vacuum commands and states like: MYDEFINEDPREFIX + "valetudo/" + this.identifier + "/command"
if MYDEFINEDPREFIX not defined then: "valetudo/" + this.identifier + "/command"
second for hass autoconf, instead "homeassistant/vacuum/valetudo_" + this.identifier + "/config"
something like MYDISCOVERYPREFIX + "/vacuum/valetudo_" + this.identifier + "/config"
if MYDISCOVERYPREFIX not defined then: "homeassistant/vacuum/valetudo_" + this.identifier + "/config"
it seems to me that this is necessary because hass has the option of configuring the discovery prefix,
and not everyone has the default value of "homeassistant" in their configuration (like me :) )
9d44048
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the benefit of those?
9d44048
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for second:
https://www.home-assistant.io/docs/mqtt/discovery/#discovery_prefix
I have my own prefix defined in all existing devices,
the vacuum cleaner should also be able to adapt this prefix