mirror of
https://github.com/koush/scrypted.git
synced 2026-02-10 01:02:18 +00:00
homekit: thermostat temp display unit. intercom cleanup.
This commit is contained in:
4
plugins/homekit/package-lock.json
generated
4
plugins/homekit/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.166",
|
||||
"version": "0.0.170",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.166",
|
||||
"version": "0.0.170",
|
||||
"dependencies": {
|
||||
"hap-nodejs": "file:../../external/HAP-NodeJS",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -40,5 +40,5 @@
|
||||
"@types/qrcode": "^1.4.1",
|
||||
"@types/url-parse": "^1.4.3"
|
||||
},
|
||||
"version": "0.0.166"
|
||||
"version": "0.0.170"
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import { CharacteristicEventTypes, DataStreamConnection, Service, WithUUID } fro
|
||||
import { RecordingManagement } from 'hap-nodejs/src/lib/camera';
|
||||
import { defaultObjectDetectionContactSensorTimeout } from '../camera-mixin';
|
||||
import os from 'os';
|
||||
import { levelToFfmpeg, profileToFfmpeg } from './camera/camera-utils';
|
||||
|
||||
const { log, mediaManager, deviceManager, systemManager } = sdk;
|
||||
|
||||
@@ -77,6 +76,8 @@ addSupportedType({
|
||||
session.videoReturn?.close();
|
||||
session.audioReturn?.close();
|
||||
session.rtpSink?.destroy();
|
||||
if (twoWayAudio)
|
||||
device.stopIntercom();
|
||||
}
|
||||
|
||||
|
||||
@@ -186,6 +187,7 @@ addSupportedType({
|
||||
const msos = await device.getVideoStreamOptions();
|
||||
selectedStream = msos.find(mso => mso.name === streamingChannel);
|
||||
}
|
||||
console.log('isHomeKitHub', isHomeKitHub, 'selected stream', selectedStream?.name || 'Default/undefined');
|
||||
|
||||
const tryReconfigureBitrate = () => {
|
||||
if (!isHomeKitHub)
|
||||
|
||||
@@ -94,8 +94,14 @@ addSupportedType({
|
||||
bindCharacteristic(device, ScryptedInterface.TemperatureSetting, service, Characteristic.CoolingThresholdTemperature,
|
||||
() => Math.max(device.thermostatSetpointHigh || 0, 10));
|
||||
|
||||
bindCharacteristic(device, ScryptedInterface.TemperatureSetting, service, Characteristic.TemperatureDisplayUnits,
|
||||
() => device.temperatureUnit === TemperatureUnit.C ? Characteristic.TemperatureDisplayUnits.CELSIUS : Characteristic.TemperatureDisplayUnits.FAHRENHEIT);
|
||||
bindCharacteristic(device, ScryptedInterface.Thermometer, service, Characteristic.TemperatureDisplayUnits,
|
||||
() => device.temperatureUnit === TemperatureUnit.F ? Characteristic.TemperatureDisplayUnits.FAHRENHEIT : Characteristic.TemperatureDisplayUnits.CELSIUS);
|
||||
|
||||
service.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
||||
.on(CharacteristicEventTypes.SET, (value: CharacteristicValue, callback: CharacteristicSetCallback) => {
|
||||
callback();
|
||||
device.setTemperatureUnit(value === Characteristic.TemperatureDisplayUnits.FAHRENHEIT ? TemperatureUnit.F : TemperatureUnit.C);
|
||||
});
|
||||
|
||||
bindCharacteristic(device, ScryptedInterface.Thermometer, service, Characteristic.CurrentTemperature,
|
||||
() => device.temperature || 0);
|
||||
|
||||
Reference in New Issue
Block a user