Skip to content

Commit

Permalink
sdk: Buttons interface
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Jan 22, 2025
1 parent 520c6a6 commit 525eb02
Show file tree
Hide file tree
Showing 6 changed files with 33 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.106",
"version": "0.3.107",
"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.98",
"version": "0.3.99",
"description": "",
"main": "dist/index.js",
"author": "",
Expand Down
23 changes: 22 additions & 1 deletion sdk/types/scrypted_python/scrypted_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class ScryptedInterface(str, Enum):
BinarySensor = "BinarySensor"
Brightness = "Brightness"
BufferConverter = "BufferConverter"
Buttons = "Buttons"
Camera = "Camera"
Charger = "Charger"
ClusterForkInterface = "ClusterForkInterface"
Expand Down Expand Up @@ -951,7 +952,7 @@ class TamperState(TypedDict):
pass


TYPES_VERSION = "0.3.98"
TYPES_VERSION = "0.3.99"


class AirPurifier:
Expand Down Expand Up @@ -1006,6 +1007,10 @@ async def convert(self, data: Any, fromMimeType: str, toMimeType: str, options:
pass


class Buttons:

buttons: list[str]

class Camera:
"""Camera devices can take still photos."""

Expand Down Expand Up @@ -1864,6 +1869,7 @@ class ScryptedInterfaceProperty(str, Enum):
colorTemperature = "colorTemperature"
rgb = "rgb"
hsv = "hsv"
buttons = "buttons"
running = "running"
paused = "paused"
docked = "docked"
Expand Down Expand Up @@ -2178,6 +2184,14 @@ def hsv(self) -> ColorHsv:
def hsv(self, value: ColorHsv):
self.setScryptedProperty("hsv", value)

@property
def buttons(self) -> list[str]:
return self.getScryptedProperty("buttons")

@buttons.setter
def buttons(self, value: list[str]):
self.setScryptedProperty("buttons", value)

@property
def running(self) -> bool:
return self.getScryptedProperty("running")
Expand Down Expand Up @@ -2612,6 +2626,13 @@ def systemDevice(self, value: ScryptedSystemDeviceInfo):
"hsv"
]
},
"Buttons": {
"name": "Buttons",
"methods": [],
"properties": [
"buttons"
]
},
"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 @@ -214,6 +214,10 @@ export interface ColorHsv {
v?: number;
}

export interface Buttons {
buttons?: ('doorbell' | string)[];
}

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

0 comments on commit 525eb02

Please sign in to comment.