Skip to content

Commit

Permalink
sdk: PressButtons
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Jan 22, 2025
1 parent e1efde3 commit 5d87a1b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
4 changes: 2 additions & 2 deletions sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/sdk",
"version": "0.3.107",
"version": "0.3.108",
"description": "",
"main": "dist/src/index.js",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions sdk/types/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/types",
"version": "0.3.99",
"version": "0.3.100",
"description": "",
"main": "dist/index.js",
"author": "",
Expand Down
17 changes: 16 additions & 1 deletion sdk/types/scrypted_python/scrypted_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class ScryptedInterface(str, Enum):
PM25Sensor = "PM25Sensor"
PositionSensor = "PositionSensor"
PowerSensor = "PowerSensor"
PressButtons = "PressButtons"
Program = "Program"
PushHandler = "PushHandler"
Readme = "Readme"
Expand Down Expand Up @@ -952,7 +953,7 @@ class TamperState(TypedDict):
pass


TYPES_VERSION = "0.3.99"
TYPES_VERSION = "0.3.100"


class AirPurifier:
Expand Down Expand Up @@ -1381,6 +1382,12 @@ class PowerSensor:

powerDetected: bool

class PressButtons:

async def pressButton(self, button: str) -> None:
pass


class Program:

async def run(self, variables: Any = None) -> Any:
Expand Down Expand Up @@ -1930,6 +1937,7 @@ class ScryptedInterfaceMethods(str, Enum):
setColorTemperature = "setColorTemperature"
setRgb = "setRgb"
setHsv = "setHsv"
pressButton = "pressButton"
sendNotification = "sendNotification"
start = "start"
stop = "stop"
Expand Down Expand Up @@ -2633,6 +2641,13 @@ def systemDevice(self, value: ScryptedSystemDeviceInfo):
"buttons"
]
},
"PressButtons": {
"name": "PressButtons",
"methods": [
"pressButton"
],
"properties": []
},
"Notifier": {
"name": "Notifier",
"methods": [
Expand Down
5 changes: 5 additions & 0 deletions sdk/types/src/types.input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ export interface Buttons {
buttons?: ('doorbell' | string)[];
}

export interface PressButtons {
pressButton(button: string): Promise<void>;
}

export interface NotificationAction {
action: string;
icon?: string;
Expand Down Expand Up @@ -2260,6 +2264,7 @@ export enum ScryptedInterface {
ColorSettingRgb = "ColorSettingRgb",
ColorSettingHsv = "ColorSettingHsv",
Buttons = "Buttons",
PressButtons = "PressButtons",
Notifier = "Notifier",
StartStop = "StartStop",
Pause = "Pause",
Expand Down

0 comments on commit 5d87a1b

Please sign in to comment.