Skip to content

Commit

Permalink
bugfixes for beta 0.2.224
Browse files Browse the repository at this point in the history
  • Loading branch information
thkl committed Apr 19, 2020
1 parent 0ff9a8a commit 7f923db
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 54 deletions.
2 changes: 0 additions & 2 deletions ChannelServices/HomeMaticHomeKitThermostatServiceIP.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ class HomeMaticHomeKitIPThermostatService extends HomeKitGenericService {
.on('get', function (callback) {
self.query('SET_POINT_TEMPERATURE', function (value) {
if (value < 6.0) {
self.getCurrentStateCharacteristic('CONTROL_MODE').setValue(1, null)
if (callback) callback(null, 0)
} else {
self.getCurrentStateCharacteristic('CONTROL_MODE').setValue(0, null)
if (callback) callback(null, 1)
}
})
Expand Down
2 changes: 1 addition & 1 deletion ChannelServices/HomeMaticHomeKitWeatherStationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const util = require('util')

class HomeMaticHomeKitWeatherStationService extends HomeKitGenericService {
propagateServices (homebridge, Service, Characteristic) {
var uuid = homebridge.uuid
var uuid = homebridge.homebridge.hap.uuid

Characteristic.IsRainingCharacteristic = function () {
var charUUID = uuid.generate('HomeMatic:customchar:IsRainingCharacteristic')
Expand Down
5 changes: 3 additions & 2 deletions ChannelServices/HomeMaticHomeKitWeatherStationServiceIP.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const util = require('util')

class HomeMaticHomeKitWeatherStationServiceIP extends HomeKitGenericService {
propagateServices (homebridge, Service, Characteristic) {
var uuid = homebridge.uuid

var uuid = homebridge.homebridge.hap.uuid
Characteristic.IsRainingCharacteristic = function () {
var charUUID = uuid.generate('HomeMatic:customchar:IsRainingCharacteristic')
Characteristic.call(this, 'Regen', charUUID)
Expand Down Expand Up @@ -100,6 +99,7 @@ class HomeMaticHomeKitWeatherStationServiceIP extends HomeKitGenericService {
}
util.inherits(Characteristic.WindRangeCharacteristic, Characteristic)

this.log.debug('[WSIP] generate WindRangeService')
Service.WindRangeService = function (displayName, subtype) {
var servUUID = uuid.generate('HomeMatic:customchar:WindRangeService')
Service.call(this, displayName, servUUID, subtype)
Expand All @@ -120,6 +120,7 @@ class HomeMaticHomeKitWeatherStationServiceIP extends HomeKitGenericService {
}
util.inherits(Characteristic.SunshineCharacteristic, Characteristic)

this.log.debug('[WSIP] generate SunshineService')
Service.SunshineService = function (displayName, subtype) {
var servUUID = uuid.generate('HomeMatic:customchar:SunshineService')
Service.call(this, displayName, servUUID, subtype)
Expand Down
4 changes: 4 additions & 0 deletions ChannelServices/channel_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@
"type": "HM-LC-Bl1PBU-FM:BLIND",
"service": "HomeMaticHomeKitBlindService"
},
{
"type": "HM-LC-Bl1-PB-FM:BLIND",
"service": "HomeMaticHomeKitBlindService"
},
{
"type": "HmIP-SWD:WATER_DETECTION_TRANSMITTER",
"service": "HomeMaticHomeKitWaterSensorService"
Expand Down
1 change: 0 additions & 1 deletion HomeMaticServiceClassLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ HomeMaticServiceClassLoader.prototype.loadChannelService = function (accessory,
} else {
self.log.warn('[ServiceClassLoader] There is no service for ' + deviceType + ':' + channelType)
}
this.log.debug('[ServiceClassLoader] == End == %s ==', accessory.appliance.serviceClassName)
}

HomeMaticServiceClassLoader.prototype.loadClass = function (serviceclass) {
Expand Down
94 changes: 47 additions & 47 deletions PluginConfigurationService/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,59 +219,59 @@ class PluginConfigurationService {
'service': service,
'options': {}
}
if (serviceInstance.validateConfig(config)) {
// build the serviceconfig
Object.keys(config).map(key => {
if (itemKeysToSave.indexOf(key) > -1) {
newServiceConfig.options[key] = config[key]
}
})
// if (serviceInstance.validateConfig(config)) {
// build the serviceconfig
Object.keys(config).map(key => {
if (itemKeysToSave.indexOf(key) > -1) {
newServiceConfig.options[key] = config[key]
}
})

// change the item in global config
let myServices = pluginHmConfig.services
if (myServices === undefined) {
logger.debug('[Save Config] empty services create a new Array')
myServices = []
// change the item in global config
let myServices = pluginHmConfig.services
if (myServices === undefined) {
logger.debug('[Save Config] empty services create a new Array')
myServices = []
}
// remove the old entry
myServices = myServices.filter(service => {
return (service.type !== address)
})
// add the new service config
myServices.push(newServiceConfig)

pluginHmConfig['services'] = myServices

// Check if its a special sevice
let serviceDev = this.serviceTemplates[service]
if ((serviceDev) && (serviceDev.special)) {
// load the special config setting
let spList = pluginHmConfig['special']
if (spList === undefined) {
spList = []
}
// remove the old entry
myServices = myServices.filter(service => {
return (service.type !== address)
})
// add the new service config
myServices.push(newServiceConfig)

pluginHmConfig['services'] = myServices

// Check if its a special sevice
let serviceDev = this.serviceTemplates[service]
if ((serviceDev) && (serviceDev.special)) {
// load the special config setting
let spList = pluginHmConfig['special']
if (spList === undefined) {
spList = []
}
var found = false
spList.map(sv => {
if (sv.name === address) {
found = true
}
})
if (found === false) {
spList.push({ name: address })
var found = false
spList.map(sv => {
if (sv.name === address) {
found = true
}
pluginHmConfig['special'] = spList
})
if (found === false) {
spList.push({ name: address })
}
pluginHmConfig['special'] = spList
}

this.saveMyConfig(pluginHmConfig)
let message = {
topic: 'reloadApplicances',
changed: data.address
}
this.process.send(message)
return true
} else {
logger.warn('[Config] configuration for %s is invalid', service)
this.saveMyConfig(pluginHmConfig)
let message = {
topic: 'reloadApplicances',
changed: data.address
}
this.process.send(message)
return true
// } else {
// logger.warn('[Config] configuration for %s is invalid', service)
// }
}
} else {
logger.warn('Serviceclass not found')
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ class HomeMaticPlatform {

process.on('SIGINT', () => {
self.homematicCCU.shutDown()
process.exit(0)
})

process.on('SIGTERM', () => {
self.homematicCCU.shutDown()
process.exit(0)
})
}
}
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": "homebridge-homematic",
"version": "0.1.222",
"version": "0.1.224",
"description": "Homematic plugin for homebridge: https://github.com/nfarina/homebridge",
"license": "ISC",
"keywords": [
Expand Down

0 comments on commit 7f923db

Please sign in to comment.