forked from seydx/homebridge-tado-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added "Dummy Switch" option to Central Switch - Added new accessory type option (LightSensor) to Solar Intensity Accessory - Added new mode (CUSTOM) to HOT_WATER devices - Fixed current state of HeaterCooler if temperature is reached - Fixed AUTO mode for HOT_WATER devices - Bugfixes
- Loading branch information
Showing
8 changed files
with
241 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
const Logger = require('../helper/logger.js'); | ||
|
||
class SolarLightsensorAccessory { | ||
|
||
constructor (api, accessory, accessories, tado) { | ||
|
||
this.api = api; | ||
this.accessory = accessory; | ||
this.accessories = accessories; | ||
|
||
this.tado = tado; | ||
|
||
this.getService(); | ||
|
||
} | ||
|
||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
// Services | ||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
|
||
getService () { | ||
|
||
let service = this.accessory.getService(this.api.hap.Service.LightSensor); | ||
let serviceOld = this.accessory.getService(this.api.hap.Service.Lightbulb); | ||
|
||
if(serviceOld){ | ||
Logger.info('Removing Lightbulb service', this.accessory.displayName); | ||
this.accessory.removeService(serviceOld); | ||
} | ||
|
||
if(!service){ | ||
Logger.info('Adding LightSensor service', this.accessory.displayName); | ||
service = this.accessory.addService(this.api.hap.Service.LightSensor, this.accessory.displayName, this.accessory.context.config.subtype); | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
module.exports = SolarLightsensorAccessory; |
Oops, something went wrong.