homebridge-panasonic-heat-pump
Advanced tools
Comparing version 1.1.10 to 1.1.11
@@ -12,2 +12,3 @@ export declare enum PanasonicSpecialStatus { | ||
} | ||
export declare function wait(time: number): Promise<unknown>; | ||
export declare class PanasonicApi { | ||
@@ -14,0 +15,0 @@ private username; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PanasonicApi = exports.PanasonicTargetOperationMode = exports.PanasonicSpecialStatus = void 0; | ||
exports.PanasonicApi = exports.wait = exports.PanasonicTargetOperationMode = exports.PanasonicSpecialStatus = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
@@ -25,2 +25,3 @@ var PanasonicSpecialStatus; | ||
} | ||
exports.wait = wait; | ||
class PanasonicApi { | ||
@@ -27,0 +28,0 @@ constructor(username, password) { |
@@ -21,3 +21,3 @@ import { PlatformAccessory } from 'homebridge'; | ||
constructor(platform: PanasonicHeatPumpHomebridgePlatform, accessory: PlatformAccessory, panasonicApi: PanasonicApi); | ||
getReadings(force?: boolean): Promise<{ | ||
getReadings(force?: boolean, afterSet?: boolean): Promise<{ | ||
temperatureNow: any; | ||
@@ -24,0 +24,0 @@ heatingCoolingState: number; |
@@ -51,8 +51,5 @@ "use strict"; | ||
const adjustedTemp = (parseInt(temp)) - readings.temperatureNow; | ||
// eslint-disable-next-line no-console | ||
console.log(`Setting Floor Heating temp[${readings.tempType}] to: ${adjustedTemp}`); | ||
this.panasonicApi.setZoneTemp(this.accessory.context.device.uniqueId, adjustedTemp, readings.tempType); | ||
await this.getReadings(true); | ||
}).onGet(async () => { | ||
console.log('Floor Heating get temp'); | ||
const readings = await this.getReadings(); | ||
@@ -78,3 +75,3 @@ return readings.targetTempSet + readings.temperatureNow; | ||
this.panasonicApi.setTankStatus(this.accessory.context.device.uniqueId, false); | ||
await this.getReadings(true); | ||
await this.getReadings(true, true); | ||
return; | ||
@@ -86,3 +83,3 @@ } | ||
this.panasonicApi.setTankStatus(this.accessory.context.device.uniqueId, true); | ||
await this.getReadings(true); | ||
await this.getReadings(true, true); | ||
}).onGet(async () => { | ||
@@ -118,3 +115,3 @@ return (await this.getReadings()).tankTargetHeatingCoolingState; | ||
} | ||
await this.getReadings(true); | ||
await this.getReadings(true, true); | ||
}).onGet(async () => { | ||
@@ -134,3 +131,3 @@ return (await this.getReadings()).ecoModeIsActive; | ||
} | ||
await this.getReadings(true); | ||
await this.getReadings(true, true); | ||
}).onGet(async () => { | ||
@@ -140,3 +137,3 @@ return (await this.getReadings()).comfortModeIsActive; | ||
} | ||
async getReadings(force = false) { | ||
async getReadings(force = false, afterSet = false) { | ||
if (force) { | ||
@@ -146,2 +143,5 @@ this.lastDetails = undefined; | ||
const loadReadings = async () => { | ||
if (afterSet) { | ||
await (0, panasonicApi_1.wait)(5000); | ||
} | ||
const details = await this.panasonicApi.loadDeviceDetails(this.accessory.context.device.uniqueId); | ||
@@ -264,3 +264,2 @@ const operationalZone = details.zoneStatus.find(z => z.temparatureNow !== null); | ||
const { outdoorTemperatureNow, temperatureNow, tankTemperatureNow, tankTemperatureSet, tankHeatingCoolingState, isActive, ecoModeIsActive, comfortModeIsActive, tankTemperatureMax, tankTemperatureMin, tankTargetHeatingCoolingState, heatingCoolingState, targetHeatingCoolingState, targetTempSet, targetTempMax, targetTempMin, } = await this.getReadings(true); | ||
console.log('updateReadings'); | ||
this.service.getCharacteristic(this.platform.Characteristic.CurrentTemperature).updateValue(temperatureNow); | ||
@@ -267,0 +266,0 @@ this.service.getCharacteristic(this.platform.Characteristic.Active).updateValue(isActive); |
{ | ||
"displayName": "Homebridge Panasonic Heat Pump", | ||
"name": "homebridge-panasonic-heat-pump", | ||
"version": "1.1.10", | ||
"version": "1.1.11", | ||
"description": "Allows basic control of Panasonic Heat Pump (AQUAREA)", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
191194
3580