Skip to content

Commit

Permalink
Apply PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
JELoohuis committed Sep 23, 2024
1 parent 2537f96 commit 0eefe40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/camera/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
TuyaCameraSettings,
} from './TuyaCameraConstants';
import TuyaTimeOutAlarmDevice from '../TuyaTimeOutAlarmDevice';
import { EventEvent } from '../webhooks/TuyaWebhookParser';

abstract class TuyaOAuth2DeviceWithCamera extends TuyaTimeOutAlarmDevice {
abstract DOORBELL_TRIGGER_FLOW: string;
Expand Down Expand Up @@ -103,8 +104,7 @@ abstract class TuyaOAuth2DeviceWithCamera extends TuyaTimeOutAlarmDevice {

// Event messages
if (statusKey === 'event_message' && changed.includes('event_message')) {
const event_message = value as { etype: string; edata: string };
this.log('Event message:', event_message.etype, event_message.edata);
const event_message = value as EventEvent['data'];
if (event_message.etype === 'ac_doorbell') {
if (!this.hasCapability('hidden.doorbell')) {
await this.addCapability('hidden.doorbell').catch(this.error);
Expand Down
2 changes: 1 addition & 1 deletion lib/webhooks/TuyaWebhookParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type IotCoreStatusEvent = {
properties?: Array<TuyaIotCoreStatusUpdate<unknown>>;
};
};
type EventEvent = {
export type EventEvent = {
event: 'event';
data: {
etype: string;
Expand Down

0 comments on commit 0eefe40

Please sign in to comment.