Skip to content

Commit

Permalink
Merge pull request #69 from Grizzelbee/Dev_0.8.0
Browse files Browse the repository at this point in the history
Dev 0.8.0
  • Loading branch information
Grizzelbee authored Feb 18, 2021
2 parents 48ae810 + 29aafc6 commit d2a5688
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
7 changes: 5 additions & 2 deletions dyson-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ module.exports.dysonAPILogIn = async function(adapter) {
headers: headers,
json: true
});
adapter.log.info(`Result from API-Status request Account is: ${response.data.accountStatus}`);

if (response.data.accountStatus === 'ACTIVE') {
adapter.log.info(`Result from API-Status request -> Account is: ${response.data.accountStatus}`);
} else {
adapter.log.warn(`Result from API-Status request -> Account is: ${response.data.accountStatus}`);
}
// Sends the login request to the API
return await axios.post(apiUri + '/v1/userregistration/authenticate?country=' + adapter.config.country,
payload,
Expand Down
14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "dysonairpurifier",
"version": "0.7.5",
"version": "0.8.0-pre",
"news": {
"0.8.0": {
"en": "Improved humidifier support and bugfixes.",
"de": "Verbesserte Luftbefeuchterunterstützung und Bugfixes.",
"ru": "Улучшенная поддержка увлажнителя и исправления.",
"pt": "Suporte para umidificador aprimorado e correções de bugs.",
"nl": "Verbeterde ondersteuning voor luchtbevochtigers en bugfixes.",
"fr": "Amélioration de la prise en charge de l'humidificateur et corrections de bogues.",
"it": "Supporto per umidificatore migliorato e correzioni di bug.",
"es": "Soporte mejorado del humidificador y corrección de errores.",
"pl": "Ulepszona obsługa nawilżacza i poprawki błędów.",
"zh-cn": "改进了加湿器支持和错误修正。"
},
"0.7.5": {
"en": "Fix: Adapter get online again after changes to dyson cloud API login procedure.",
"de": "Fix: Der Adapter wird nach Änderungen am Anmeldeverfahren der Dyson Cloud API wieder online geschaltet.",
Expand Down
19 changes: 11 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ const datapoints = [
['p10r' , 'PM10R' , 'PM-10R - Particulate Matter 10µm' , 'number', 'false', 'value' ,'µg/m³' ],
['hmod' , 'HeaterMode' , 'Heating Mode [ON/OFF]' , 'string', 'true', 'switch' ,'', {'OFF': 'OFF', 'ON': 'ON'} ],
['hmax' , 'TemperatureTarget' , 'Target temperature for heating' , 'number', 'true', 'value.temperature' ,'' ],
['hume' , 'HumidificationMode' , 'HumidificationMode Switch [ON/OFF]' , 'string', 'true', 'switch' ,'', {'OFF': 'OFF', 'ON': 'ON'} ],
['hume' , 'HumidificationMode' , 'HumidificationMode Switch [ON/OFF]' , 'string', 'true', 'switch' ,'', {'OFF': 'OFF', 'HUMD': 'ON'} ],
['haut' , 'HumidifyAutoMode' , 'Humidify AutoMode [ON/OFF]' , 'string', 'true', 'switch' ,'', {'OFF': 'OFF', 'ON': 'ON'} ],
['humt' , 'HumidificationTarget' , 'Manual Humidification Target' , 'string', 'false', 'text' ,'' ],
['cdrr' , 'CleanDurationRemaining' , 'Clean Duration Remaining' , 'string', 'false', 'text' ,'' ],
['rect' , 'AutoHumidificationTarget' , 'Auto Humidification target' , 'string', 'false', 'text' ,'' ],
['cltr' , 'TimeRemainingToNextClean' , 'Time Remaining to Next Clean' , 'string', 'false', 'text' ,'' ],
['wath' , 'WaterHardness' , 'Water Hardness' , 'string', 'false', 'text' ,'' ]
['humt' , 'HumidificationTarget' , 'Manual Humidification Target' , 'number', 'true', 'value' ,'%' ],
['cdrr' , 'CleanDurationRemaining' , 'Clean Duration Remaining' , 'number', 'false', 'value' ,'' ],
['rect' , 'AutoHumidificationTarget' , 'Auto Humidification target' , 'number', 'true', 'value' ,'%' ],
['cltr' , 'TimeRemainingToNextClean' , 'Time Remaining to Next Clean' , 'number', 'false', 'value' ,'hours' ],
['wath' , 'WaterHardness' , 'Water Hardness' , 'number', 'true', 'value' ,'', {675: 'Hard', 1350:'Medium', 2025:'Soft'}]
];

/**
Expand Down Expand Up @@ -404,9 +404,12 @@ class dysonAirPurifier extends utils.Adapter {
if (typeof (value) === 'object') {
if (value[0] === value[1]) {
this.log.debug('Values for [' + deviceConfig[1] + '] are equal. No update required. Skipping.');
continue;
} else {
value = value[1];
value = value[1].valueOf();
}
this.log.debug(`Value is an object. Converting to value: [${JSON.stringify(value)}] --> [${value.valueOf()}]`);
value = value.valueOf();
}
// deviceConfig.length>7 means the data field has predefined states attached, that need to be handled
if (deviceConfig.length > 7) {
Expand Down Expand Up @@ -789,7 +792,7 @@ class dysonAirPurifier extends utils.Adapter {
}
this.main();
} else {
throw new Error('This adapter requires at least js-controller V3.0.0. Your system is not compatible. Please update.');
throw new Error('This adapter requires at least js-controller V3.0.0. Your system is not compatible. Please update your system.');
}
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.dysonairpurifier",
"version": "0.7.5",
"version": "0.8.0-pre",
"description": "ioBroker Adapter for dyson air purifiers and fans",
"author": {
"name": "Hanjo Hingsen",
Expand Down
13 changes: 12 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,16 @@ This adapter is currently able to control the following states of your devices:
* ContinuousMonitoring , Continuous Monitoring of environmental sensors even if device is off.
* MainPower , Main Power of fan.
* AutomaticMode , Fan is in automatic mode.
* Fandirection , Direction the fan blows to. ON=Front; OFF=Back (aka Jet focus)
* Flowdirection , Direction the fan blows to. ON=Front; OFF=Back (aka Jet focus)
* Jetfocus , Direction the fan blows to. ON=Front; OFF=Back (aka Jet focus)
* HeatingMode , Heating Mode [ON/OFF]
* HeatingTargetTemp , Target temperature for heating
* AirQualityTarget , Target air quality for auto mode.
* HumidificationMode , On / Off
* HumidifyAutoMode , Auto / Off
* AutoHumidificationTarget , Auto HumidificationTarget
* HumidificationTarget , Manual HumidificationTarget
* WaterHardness , Soft, Medium, Hard

Possible values for these states are documented below, as far as known.
Fan speed only allows values from 1 to 10 and Auto. If you like to set your fan speed down to 0 you'll need to power off the main power.
Expand All @@ -106,6 +111,12 @@ Which is what the dyson app does also.

## Changelog

### 0.8.0 (2021-02-18) (Beyond the mirror)
* (grizzelbee) New: Log as info if account is active on login; else log as warning.
* (grizzelbee) New: [#21](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/21) Improvement for humidifier support
* (grizzelbee) Fix: [#67](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/67) Adapter sometimes wrote objects instead of values.


### 0.7.5 (2021-02-12) (I won't surrender)
* (grizzelbee) Fix: [#65](https://github.com/Grizzelbee/ioBroker.dysonairpurifier/issues/65) Adapter get online again after changes to dyson cloud API login procedure.
* (grizzelbee) New: Adapter reconnects with new host address when it gets changed manually
Expand Down

0 comments on commit d2a5688

Please sign in to comment.