mirror of
https://github.com/koush/scrypted.git
synced 2026-05-25 06:00:31 +01:00
homekit: boolean properties are 0/1
This commit is contained in:
@@ -564,7 +564,7 @@ addSupportedType({
|
||||
const persistBooleanCharacteristic = (service: Service, characteristic: WithUUID<{ new(): Characteristic }>) => {
|
||||
const property = `characteristic-v2-${characteristic.UUID}`
|
||||
service.getCharacteristic(characteristic)
|
||||
.on(CharacteristicEventTypes.GET, callback => callback(null, storage.getItem(property) === 'true'))
|
||||
.on(CharacteristicEventTypes.GET, callback => callback(null, storage.getItem(property) === 'true' ? 1 : 0))
|
||||
.on(CharacteristicEventTypes.SET, (value, callback) => {
|
||||
callback();
|
||||
storage.setItem(property, (!!value).toString());
|
||||
|
||||
Reference in New Issue
Block a user