Skip to content

Commit

Permalink
release v9.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Nov 11, 2024
1 parent f4ee1a3 commit 1b65061
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 40 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [9.4.2] - (11.11.2024)

## Changes

- fix reconnect if error ocurred during start
- correct some logs wording
- config.schema updated
- cleanup

## [9.4.1] - (30.10.2024)

## Changes
Expand Down
20 changes: 7 additions & 13 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"condition": {
"functionBody": "return model.devices[arrayIndices].envoyFirmware7xx === true;"
},
"required": true
"required": false
},
"envoyPasswd": {
"title": "Envoy Password",
Expand Down Expand Up @@ -1081,7 +1081,6 @@
"profile": {
"title": "Profile",
"type": "string",
"default": "backup",
"oneOf": [
{
"title": "Savings",
Expand Down Expand Up @@ -1121,7 +1120,7 @@
}
],
"description": "Here select the profile.",
"required": true
"required": false
},
"displayType": {
"title": "Type",
Expand Down Expand Up @@ -1237,7 +1236,6 @@
"gridMode": {
"title": "Mode",
"type": "string",
"default": "on-grid",
"oneOf": [
{
"title": "Grid On",
Expand Down Expand Up @@ -1277,7 +1275,7 @@
}
],
"description": "Here select the grid mode.",
"required": true
"required": false
},
"displayType": {
"title": "Type",
Expand Down Expand Up @@ -1342,7 +1340,6 @@
"compareMode": {
"title": "Compare Mode",
"type": "integer",
"default": 2,
"oneOf": [
{
"title": ">",
Expand Down Expand Up @@ -1376,7 +1373,7 @@
}
],
"description": "Here select the compare mode.",
"required": true
"required": false
},
"backupLevel": {
"title": "Level",
Expand Down Expand Up @@ -1558,7 +1555,6 @@
"gridMode": {
"title": "Mode",
"type": "string",
"default": "on-grid",
"oneOf": [
{
"title": "Grid On",
Expand Down Expand Up @@ -1598,7 +1594,7 @@
}
],
"description": "Here select the grid mode.",
"required": true
"required": false
},
"displayType": {
"title": "Type",
Expand Down Expand Up @@ -1674,7 +1670,6 @@
"gridMode": {
"title": "Mode",
"type": "string",
"default": "on-grid",
"oneOf": [
{
"title": "Grid On",
Expand Down Expand Up @@ -1714,7 +1709,7 @@
}
],
"description": "Here select the grid mode.",
"required": true
"required": false
},
"displayType": {
"title": "Type",
Expand Down Expand Up @@ -1971,7 +1966,6 @@
"mode": {
"title": "Mode",
"type": "string",
"default": "off",
"oneOf": [
{
"title": "Off",
Expand All @@ -1993,7 +1987,7 @@
}
],
"description": "Here select the mode.",
"required": true
"required": false
},
"displayType": {
"title": "Type",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"displayName": "Enphase Envoy",
"name": "homebridge-enphase-envoy",
"version": "9.4.1",
"version": "9.4.2",
"description": "Homebridge plugin for Photovoltaic Energy System manufactured by Enphase.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
53 changes: 27 additions & 26 deletions src/envoydevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ class EnvoyDevice extends EventEmitter {

return true;
} catch (error) {
this.emit('error', `Start error: ${error}`);
throw new Error(`Start error: ${error}`);
};
};

Expand Down Expand Up @@ -1098,7 +1098,7 @@ class EnvoyDevice extends EventEmitter {
return true;
} catch (error) {
this.getJwtTokenRunning = this.getJwtTokenRunning ? false : this.getJwtTokenRunning;
throw new Error(`Requesting JWT token error: ${error.message || error}`);
throw new Error(`Get JWT token error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -1144,7 +1144,7 @@ class EnvoyDevice extends EventEmitter {

return true;
} catch (error) {
throw new Error(`Requeating validate JWT token error: ${error.message || error}`);
throw new Error(`Validate JWT token error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -1299,7 +1299,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Info', parseInfoData) : false;
return true;
} catch (error) {
throw new Error(`Requesting info error: ${error.message || error}`);
throw new Error(`Update info error: ${error.message || error}`);
};
};

Expand All @@ -1322,7 +1322,7 @@ class EnvoyDevice extends EventEmitter {

return true;
} catch (error) {
this.emit('warn', `Caalculaate envoy password error: ${error.message || error}, dont worry all working correct, only the power and power max of microinverters will not be displayed.`);
this.emit('warn', `Calculaate envoy password error: ${error.message || error}, dont worry all working correct, only the power and power max of microinverters will not be displayed.`);
return false;
};
};
Expand Down Expand Up @@ -1375,7 +1375,7 @@ class EnvoyDevice extends EventEmitter {

return true;
} catch (error) {
this.emit('warn', `Installer password error: ${error.message || error}, dont worry all working correct, only the power production state/control and plc level will not be displayed.`);
this.emit('warn', `Calculate installer password error: ${error.message || error}, dont worry all working correct, only the power production state/control and plc level will not be displayed.`);
return false;
};
};
Expand Down Expand Up @@ -1546,7 +1546,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Home', envoy) : false;
return true;
} catch (error) {
throw new Error(`Requesting home error: ${error.message || error}`);
throw new Error(`Update home error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -1812,7 +1812,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Inventory', inventory) : false;
return true;
} catch (error) {
throw new Error(`Requesting inventory error: ${error.message || error}`);
throw new Error(`Update inventory error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -1893,7 +1893,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Meters', meters) : false;
return metersEnabled;
} catch (error) {
throw new Error(`Requesting meters error: ${error.message || error}`);
throw new Error(`Update meters error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -1960,7 +1960,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Meters Reading', metersReading) : false;
return true;
} catch (error) {
throw new Error(`Requesting meters reading error: ${error.message || error}`);
throw new Error(`Update meters reading error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -2017,7 +2017,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Microinverters', microinverters) : false;
return true;
} catch (error) {
throw new Error(`Requesting microinverters status error: ${error.message || error}`);
throw new Error(`Update microinverters status error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -2057,7 +2057,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Production', production) : false;
return true;
} catch (error) {
throw new Error(`Requesting production error: ${error.message || error}`);
throw new Error(`Update production error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -2481,7 +2481,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Production CT', productionCtData) : false;
return true;
} catch (error) {
throw new Error(`Requesting production ct error: ${error.message || error}`);
throw new Error(`Update production ct error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -2539,7 +2539,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Power Mode', powerProductionState) : false;
return true;
} catch (error) {
throw new Error(`Requesting power production state error: ${error.message || error}`);
throw new Error(`Update power production state error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -2774,7 +2774,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Ensemble Inventory', ensembleInventory) : false;
return true;
} catch (error) {
throw new Error(`Requesting ensemble inventory error: ${error.message || error}`);
throw new Error(`Update ensemble inventory error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3098,7 +3098,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Ensemble Status', ensembleStatus) : false;
return true;
} catch (error) {
throw new Error(`Requesting ensemble status error: ${error.message || error}`);
throw new Error(`Update ensemble status error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3150,7 +3150,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Encharge Settings', enchargeSettings) : false;
return true;
} catch (error) {
throw new Error(`Requesting encharge settings. error: ${error.message || error}`);
throw new Error(`Update encharge settings. error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3347,7 +3347,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Tariff', tariffSettings) : false;
return true;
} catch (error) {
throw new Error(`Requesting tariff. error: ${error.message || error}`);
throw new Error(`Update tariff. error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3405,7 +3405,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Dry Contacts', ensembleDryContacts) : false;
return true;
} catch (error) {
throw new Error(`Requesting dry contacts error: ${error.message || error}`);
throw new Error(`Update dry contacts error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3470,7 +3470,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Dry Contacts Settings', ensembleDryContactsSettings) : false;
return true;
} catch (error) {
throw new Error(`Requesting dry contacts settings error: ${error.message || error}`);
throw new Error(`Update dry contacts settings error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3599,7 +3599,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Generator', ensembleGenerator) : false;
return true;
} catch (error) {
throw new Error(`Requesting generator error: ${error.message || error}`);
throw new Error(`Update generator error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3647,7 +3647,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Generator Settings', generatorSettings) : false;
return true;
} catch (error) {
throw new Error(`Requesting generator settings error: ${error.message || error}`);
throw new Error(`Update generator settings error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3756,7 +3756,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'PLC Level', plcLevel) : false;
return true;
} catch (error) {
throw new Error(`Requesting plc level error: ${error.message || error}`);
throw new Error(`Update plc level error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -3942,7 +3942,7 @@ class EnvoyDevice extends EventEmitter {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'Live Data', live) : false;
return true;
} catch (error) {
throw new Error(`Requesting live data error: ${error.message || error}`);
throw new Error(`Update live data error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -4145,7 +4145,7 @@ class EnvoyDevice extends EventEmitter {
const debug = this.enableDebugMode ? this.emit('debug', `Live data stream enable:`, response.data) : false;
return;
} catch (error) {
throw new Error(`Requesting live data stream enable error: ${error.message || error}`);
throw new Error(`Set live data stream enable error: ${error.message || error}`);
};
};

Expand Down Expand Up @@ -4276,7 +4276,8 @@ class EnvoyDevice extends EventEmitter {
.setCharacteristic(Characteristic.Manufacturer, 'Enphase')
.setCharacteristic(Characteristic.Model, this.pv.envoy.modelName ?? 'Model Name')
.setCharacteristic(Characteristic.SerialNumber, this.pv.envoy.serialNumber ?? 'Serial Number')
.setCharacteristic(Characteristic.FirmwareRevision, this.pv.envoy.software.replace(/[a-zA-Z]/g, '') ?? '0');
.setCharacteristic(Characteristic.FirmwareRevision, this.pv.envoy.software.replace(/[a-zA-Z]/g, '') ?? '0')
.setCharacteristic(Characteristic.ConfiguredName, accessoryName);

//system and envoy
if (envoyInstalled) {
Expand Down

0 comments on commit 1b65061

Please sign in to comment.