Skip to content

Commit

Permalink
Merge pull request #408 from martijnpoppen/feature/T8600-E330
Browse files Browse the repository at this point in the history
NEW: Add T8600 (E330)
  • Loading branch information
bropat authored Jan 2, 2024
2 parents 03a48bb + c4a76c8 commit 5bc9445
Show file tree
Hide file tree
Showing 10 changed files with 511 additions and 27 deletions.
Binary file added docs/_media/eufycame330_large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_media/eufycame330_small.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/supported_devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| ![T8141 image](_media/eufycam2cpro_small.jpg) | eufyCam 2C Pro (T8141) | :heavy_check_mark: | |
| ![T8160 image](_media/eufycam3_small.jpg) | S330 eufyCam (T8160; eufyCam 3) | :heavy_check_mark: | Firmware: 3.1.8.6 (20221101) |
| ![T8161 image](_media/eufycam3c_small.jpg) | S300 eufyCam (T8161; eufyCam 3C) | :heavy_check_mark: | Firmware: 3.1.8.6 (20221101) |
| ![T8600 image](_media/eufycame330_small.jpg) | eufyCam E330 (Professional; T8600) | :heavy_check_mark: | Firmware: 0.5.9.5 (20231218) |
| ![T8130 image](_media/solocame20_small.jpg) | SoloCam E20 (T8130) | :heavy_check_mark: | |
| ![T8131 image](_media/solocame40_small.jpg) | SoloCam E40 (T8131) | :heavy_check_mark: | |
| ![T8122 image](_media/solocaml20_small.jpg) | SoloCam L20 (T8122) | :heavy_check_mark: | Firmware: 1.0.8.1 |
Expand Down
23 changes: 22 additions & 1 deletion src/eufysecurity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { PushNotificationService } from "./push/service";
import { Credentials, PushMessage } from "./push/models";
import { BatteryDoorbellCamera, Camera, Device, EntrySensor, FloodlightCamera, GarageCamera, IndoorCamera, Keypad, Lock, MotionSensor, SmartSafe, SoloCamera, UnknownDevice, WallLightCam, WiredDoorbellCamera, Tracker } from "./http/device";
import { AlarmEvent, ChargingType, CommandType, DatabaseReturnCode, P2PConnectionType, SmartSafeAlarm911Event, SmartSafeShakeAlarmEvent, TFCardStatus } from "./p2p/types";
import { DatabaseCountByDate, DatabaseQueryLatestInfo, DatabaseQueryLocal, StreamMetadata, DatabaseQueryLatestInfoLocal, DatabaseQueryLatestInfoCloud, RGBColor, DynamicLighting, MotionZone } from "./p2p/interfaces";
import { DatabaseCountByDate, DatabaseQueryLatestInfo, DatabaseQueryLocal, StreamMetadata, DatabaseQueryLatestInfoLocal, DatabaseQueryLatestInfoCloud, RGBColor, DynamicLighting, MotionZone, CrossTrackingGroupEntry } from "./p2p/interfaces";
import { CommandResult, StorageInfoBodyHB3 } from "./p2p/models";
import { generateSerialnumber, generateUDID, getError, handleUpdate, md5, parseValue, removeLastChar, waitForEvent } from "./utils";
import { DeviceNotFoundError, StationNotFoundError, ReadOnlyPropertyError, NotSupportedError, AddUserError, DeleteUserError, UpdateUserUsernameError, UpdateUserPasscodeError, UpdateUserScheduleError, ensureError } from "./error";
Expand Down Expand Up @@ -1574,6 +1574,12 @@ export class EufySecurity extends TypedEmitter<EufySecurityEvents> {
}
break;
}
case PropertyName.DeviceImageMirrored:
station.setMirrorMode(device, value as boolean);
break;
case PropertyName.DeviceFlickerAdjustment:
station.setFlickerAdjustment(device, value as number);
break;
default:
if (!Object.values(PropertyName).includes(name as PropertyName))
throw new ReadOnlyPropertyError("Property is read only", { context: { device: deviceSN, propertyName: name, propertyValue: value } });
Expand Down Expand Up @@ -1626,6 +1632,21 @@ export class EufySecurity extends TypedEmitter<EufySecurityEvents> {
case PropertyName.StationTurnOffAlarmWithButton:
station.setStationTurnOffAlarmWithButton(value as boolean);
break;
case PropertyName.StationCrossCameraTracking:
station.setCrossCameraTracking(value as boolean);
break;
case PropertyName.StationContinuousTrackingTime:
station.setContinuousTrackingTime(value as number);
break;
case PropertyName.StationTrackingAssistance:
station.setTrackingAssistance(value as boolean);
break;
case PropertyName.StationCrossTrackingCameraList:
station.setCrossTrackingCameraList(value as Array<string>);
break;
case PropertyName.StationCrossTrackingGroupList:
station.setCrossTrackingGroupList(value as Array<CrossTrackingGroupEntry>);
break;
default:
if (!Object.values(PropertyName).includes(name as PropertyName))
throw new ReadOnlyPropertyError("Property is read only", { context: { station: stationSN, propertyName: name, propertyValue: value } });
Expand Down
15 changes: 14 additions & 1 deletion src/http/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ export class Device extends TypedEmitter<DeviceEvents> {
this.log.error("Device convert raw property - CMD_BAT_DOORBELL_RECORD_QUALITY2 Error", { error: getError(error), deviceSN: this.getSerial(), property: property, value: value });
return numericProperty.default !== undefined ? numericProperty.default : (numericProperty.min !== undefined ? numericProperty.min : 0);
}
} else if (property.key === CommandType.CMD_DEV_RECORD_AUTOSTOP && this.getDeviceType() === DeviceType.PROFESSIONAL_247) {
return value !== undefined ? (value === "0" ? true : false) : false;
} else if (property.type === "number") {
const numericProperty = property as PropertyMetadataNumeric;
try {
Expand Down Expand Up @@ -800,6 +802,7 @@ export class Device extends TypedEmitter<DeviceEvents> {
type == DeviceType.CAMERA2_PRO ||
type == DeviceType.CAMERA3 ||
type == DeviceType.CAMERA3C ||
type == DeviceType.PROFESSIONAL_247 ||
type == DeviceType.INDOOR_CAMERA_1080 ||
type == DeviceType.INDOOR_PT_CAMERA_1080 ||
type == DeviceType.OUTDOOR_PT_CAMERA ||
Expand Down Expand Up @@ -839,6 +842,7 @@ export class Device extends TypedEmitter<DeviceEvents> {
type == DeviceType.CAMERA2_PRO ||
type == DeviceType.CAMERA3 ||
type == DeviceType.CAMERA3C ||
type == DeviceType.PROFESSIONAL_247 ||
type == DeviceType.SOLO_CAMERA ||
type == DeviceType.SOLO_CAMERA_PRO ||
type == DeviceType.SOLO_CAMERA_SPOTLIGHT_1080 ||
Expand Down Expand Up @@ -1121,8 +1125,13 @@ export class Device extends TypedEmitter<DeviceEvents> {
return DeviceType.CAMERA3C == type;
}

static isCameraProfessional247(type: number): boolean {
// T8600 - E330
return DeviceType.PROFESSIONAL_247 == type;
}

static isCamera3Product(type: number): boolean {
return Device.isCamera3(type) || Device.isCamera3C(type);
return Device.isCamera3(type) || Device.isCamera3C(type) || Device.isCameraProfessional247(type);
}

static isEntrySensor(type: number): boolean {
Expand Down Expand Up @@ -1373,6 +1382,10 @@ export class Device extends TypedEmitter<DeviceEvents> {
return Device.isCamera3C(this.rawDevice.device_type);
}

public isCameraProfessional247(): boolean {
return Device.isCameraProfessional247(this.rawDevice.device_type);
}

public isCamera3Product(): boolean {
return Device.isCamera3Product(this.rawDevice.device_type);
}
Expand Down
4 changes: 3 additions & 1 deletion src/http/parameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export class ParameterHelper {
type === CommandType.CMD_INDOOR_DET_SET_ACTIVE_ZONE ||
type === CommandType.CMD_SET_PRIVACYPARAM ||
type === CommandType.CMD_BAT_DOORBELL_VIDEO_QUALITY2 ||
type === CommandType.CMD_BAT_DOORBELL_RECORD_QUALITY2) {
type === CommandType.CMD_BAT_DOORBELL_RECORD_QUALITY2 ||
type === CommandType.CMD_SET_CROSS_TRACKING_CAMERA_LIST ||
type === CommandType.CMD_SET_CROSS_TRACKING_GROUP_LIST) {
if (typeof value === "string") {
const parsedValue = parseJSON(getNullTerminatedString(decodeBase64(value), "utf-8"), log);
if (parsedValue === undefined) {
Expand Down
Loading

0 comments on commit 5bc9445

Please sign in to comment.