Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions MMM-HASS.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ Module.register('MMM-HASS', {
valueWrapper.innerHTML = '<i class="dimmed ' + self.config.devices[index].deviceReadings[indexValue].icon + '"></i>';
}

// add prefix
if (self.config.devices[index].deviceReadings[indexValue].prefix) {
valueWrapper.innerHTML += self.config.devices[index].deviceReadings[indexValue].prefix;
}

valueWrapper.innerHTML += value;

// add suffix
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ To use this module, add it to the modules array in the `config/config.js` file:
host: "your_home_assistant_ip",
port: "your_home_assistant_port",
apipassword: "your_home_assistant_api_password",
token: "your_home_assistant_long-lived_access_token",
hassiotoken: false,
https: false,
devices: [
{ deviceLabel: "Exterior",
deviceReadings: [
{ sensor: "sensor.netatmo_outdoor_temperature", icon: "wi wi-thermometer", suffix: "°"},
{ sensor: "sensor.netatmo_outdoor_temperature", icon: "wi wi-thermometer", prefix: "", suffix: "°"},
{ sensor: "sensor.netatmo_outdoor_humidity", icon: "wi wi-humidity", suffix: "%"},
{ sensor: "sensor.netatmo_outdoor_battery", icon: "fa fa-battery-full", suffix: ""}
]
Expand Down
4 changes: 2 additions & 2 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = NodeHelper.create({
json: params
};
if(config.hassiotoken) {
post_options.headers = { 'Authorization' : 'Bearer ' + process.env.HASSIO_TOKEN };
post_options.headers = { 'Authorization' : 'Bearer ' + config.token };
}

var post_req = request(post_options, function(error, response, body) {
Expand Down Expand Up @@ -173,7 +173,7 @@ module.exports = NodeHelper.create({
json: true
};
if(config.hassiotoken) {
get_options.headers = { 'Authorization' : 'Bearer ' + process.env.HASSIO_TOKEN };
get_options.headers = { 'Authorization' : 'Bearer ' + config.token };
}
request(get_options, function(error, response, body) {
completed_requests++;
Expand Down