Add power binary sensor for Cooktop in SmartThings (#141482)

This commit is contained in:
Joost Lekkerkerker 2025-03-26 16:29:02 +01:00 committed by GitHub
parent 9d63a49812
commit 3a1e1684ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 917 additions and 0 deletions

View File

@ -134,6 +134,7 @@ CAPABILITY_TO_SENSORS: dict[
is_on_key="on",
category={
Category.CLOTHING_CARE_MACHINE,
Category.COOKTOP,
Category.DISHWASHER,
Category.DRYER,
Category.MICROWAVE,

View File

@ -188,6 +188,7 @@ class SmartThingsSwitch(SmartThingsEntity, SwitchEntity):
MAIN
].manufacturer_category not in {
Category.CLOTHING_CARE_MACHINE,
Category.COOKTOP,
Category.DRYER,
Category.WASHER,
Category.MICROWAVE,
@ -231,6 +232,7 @@ class SmartThingsSwitch(SmartThingsEntity, SwitchEntity):
MAIN
].manufacturer_category not in {
Category.CLOTHING_CARE_MACHINE,
Category.COOKTOP,
Category.DRYER,
Category.WASHER,
Category.MICROWAVE,

View File

@ -117,6 +117,7 @@ def mock_smartthings() -> Generator[AsyncMock]:
"da_wm_sc_000001",
"da_rvc_normal_000001",
"da_ks_microwave_0101x",
"da_ks_cooktop_31001",
"da_ks_range_0101x",
"da_ks_oven_01061",
"hue_color_temperature_bulb",

View File

@ -0,0 +1,508 @@
{
"components": {
"burner-02": {
"samsungce.surfaceResidualHeat": {
"surfaceResidualHeat": {
"value": "normal",
"timestamp": "2025-03-25T18:18:28.550Z"
}
},
"samsungce.cooktopHeatingPower": {
"manualLevel": {
"value": 0,
"timestamp": "2025-03-26T05:57:23.203Z"
},
"heatingMode": {
"value": "manual",
"timestamp": "2025-03-25T18:18:28.550Z"
},
"manualLevelMin": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.550Z"
},
"supportedHeatingModes": {
"value": ["manual", "boost", "keepWarm"],
"timestamp": "2025-03-25T18:18:28.550Z"
},
"manualLevelMax": {
"value": 15,
"timestamp": "2025-03-25T18:18:28.550Z"
}
},
"samsungce.countDownTimer": {
"startValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.550Z"
},
"currentValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.550Z"
},
"status": {
"value": "idle",
"timestamp": "2025-03-25T18:18:28.550Z"
}
}
},
"burner-01": {
"samsungce.surfaceResidualHeat": {
"surfaceResidualHeat": {
"value": "normal",
"timestamp": "2025-03-25T18:18:28.518Z"
}
},
"samsungce.cooktopHeatingPower": {
"manualLevel": {
"value": 0,
"timestamp": "2025-03-26T05:57:23.203Z"
},
"heatingMode": {
"value": "manual",
"timestamp": "2025-03-25T18:18:28.518Z"
},
"manualLevelMin": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.518Z"
},
"supportedHeatingModes": {
"value": ["manual", "boost", "keepWarm"],
"timestamp": "2025-03-25T18:18:28.518Z"
},
"manualLevelMax": {
"value": 15,
"timestamp": "2025-03-25T18:18:28.518Z"
}
},
"samsungce.countDownTimer": {
"startValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.518Z"
},
"currentValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.518Z"
},
"status": {
"value": "idle",
"timestamp": "2025-03-25T18:18:28.518Z"
}
}
},
"main": {
"custom.disabledComponents": {
"disabledComponents": {
"value": ["burner-6"],
"timestamp": "2025-03-25T18:18:28.464Z"
}
},
"custom.userNotification": {
"message": {
"value": null
}
},
"samsungce.remoteManagementData": {
"reportRawData": {
"value": "AgUBASCgAwAACaEDAAAM4AQAAAAA4QHwAw==",
"timestamp": "2025-03-26T07:27:58.282Z"
},
"version": {
"value": "CT-31.0001",
"timestamp": "2025-03-25T18:18:28.476Z"
}
},
"samsungce.deviceIdentification": {
"micomAssayCode": {
"value": "5828",
"timestamp": "2025-03-25T18:18:28.476Z"
},
"modelName": {
"value": "NZ64B5046GK",
"timestamp": "2025-03-25T18:18:28.476Z"
},
"serialNumber": {
"value": "B8C878DX900290H",
"timestamp": "2025-03-25T18:18:28.476Z"
},
"serialNumberExtra": {
"value": "N/A",
"timestamp": "2025-03-25T18:18:28.476Z"
},
"modelClassificationCode": {
"value": "50000204001611000E00000000000000",
"timestamp": "2025-03-25T18:18:28.476Z"
},
"description": {
"value": "N/A",
"timestamp": "2025-03-25T18:18:28.476Z"
},
"releaseYear": {
"value": null
},
"binaryId": {
"value": "TP2X_DA-KS-COOKTOP-31001",
"timestamp": "2025-03-25T18:18:28.476Z"
}
},
"switch": {
"switch": {
"value": "off",
"timestamp": "2025-03-26T07:27:58.478Z"
}
},
"samsungce.errorAndAlarmState": {
"events": {
"value": [],
"timestamp": "2025-03-25T18:18:28.476Z"
}
},
"samsungce.cooktopFlexZone": {
"flexZones": {
"value": [],
"timestamp": "2025-03-26T05:57:23.671Z"
}
},
"samsungce.softwareVersion": {
"versions": {
"value": [
{
"id": "Wifi",
"swType": "Wifi-Application",
"versionNumber": "80001A220811",
"description": "Aug 11 2022 08:38:36, Wifi:ws029_030, STDK : 1.7.4)"
},
{
"id": "Micom",
"swType": "Micom Software",
"versionNumber": "240617",
"description": "Description for this micom version"
}
],
"timestamp": "2025-03-25T18:18:28.482Z"
}
},
"healthCheck": {
"checkInterval": {
"value": null
},
"healthStatus": {
"value": null
},
"DeviceWatch-Enroll": {
"value": null
},
"DeviceWatch-DeviceStatus": {
"value": null
}
},
"custom.cooktopOperatingState": {
"supportedCooktopOperatingState": {
"value": ["ready", "run", "paused"],
"timestamp": "2025-03-26T07:26:39.690Z"
},
"cooktopOperatingState": {
"value": "ready",
"timestamp": "2025-03-26T07:27:58.652Z"
}
},
"samsungce.kitchenDeviceIdentification": {
"regionCode": {
"value": "EU",
"timestamp": "2025-03-25T18:18:28.501Z"
},
"modelCode": {
"value": "OZ8500B/EU2",
"timestamp": "2025-03-25T18:18:28.501Z"
},
"fuel": {
"value": null
},
"type": {
"value": "cooktop",
"timestamp": "2025-03-25T18:18:28.501Z"
},
"representativeComponent": {
"value": null
}
},
"samsungce.softwareUpdate": {
"targetModule": {
"value": null
},
"otnDUID": {
"value": "JHCB2ZD4E2KRY",
"timestamp": "2025-03-25T18:18:28.482Z"
},
"lastUpdatedDate": {
"value": null
},
"availableModules": {
"value": [],
"timestamp": "2025-03-25T18:18:28.501Z"
},
"newVersionAvailable": {
"value": false,
"timestamp": "2025-03-25T18:18:28.501Z"
},
"operatingState": {
"value": null
},
"progress": {
"value": null
}
},
"samsungce.kidsLockControl": {
"lockState": {
"value": "unlocked",
"timestamp": "2025-03-25T18:18:28.476Z"
}
},
"audioMute": {
"mute": {
"value": "unmuted",
"timestamp": "2025-03-25T18:18:28.464Z"
}
}
},
"burner-06": {
"samsungce.surfaceResidualHeat": {
"surfaceResidualHeat": {
"value": "normal",
"timestamp": "2025-03-25T18:18:28.591Z"
}
},
"samsungce.cooktopHeatingPower": {
"manualLevel": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.591Z"
},
"heatingMode": {
"value": "manual",
"timestamp": "2025-03-25T18:18:28.591Z"
},
"manualLevelMin": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.591Z"
},
"supportedHeatingModes": {
"value": ["manual", "boost", "keepWarm"],
"timestamp": "2025-03-25T18:18:28.591Z"
},
"manualLevelMax": {
"value": 15,
"timestamp": "2025-03-25T18:18:28.591Z"
}
},
"samsungce.countDownTimer": {
"startValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.591Z"
},
"currentValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.591Z"
},
"status": {
"value": null
}
}
},
"hood": {
"samsungce.connectionState": {
"connectionState": {
"value": "disconnected",
"timestamp": "2025-03-25T18:18:28.650Z"
}
},
"samsungce.hoodFanSpeed": {
"settableMaxFanSpeed": {
"value": 5,
"timestamp": "2025-03-25T18:18:28.650Z"
},
"hoodFanSpeed": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.650Z"
},
"supportedHoodFanSpeed": {
"value": [1, 2, 3, 4, 5],
"timestamp": "2025-03-25T18:18:28.650Z"
},
"settableMinFanSpeed": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.650Z"
}
},
"samsungce.countDownTimer": {
"startValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.650Z"
},
"currentValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.646Z"
},
"status": {
"value": null
}
},
"switch": {
"switch": {
"value": null
}
},
"samsungce.lamp": {
"brightnessLevel": {
"value": null
},
"supportedBrightnessLevel": {
"value": ["off", "mid"],
"timestamp": "2025-03-25T18:18:28.650Z"
}
}
},
"burner-05": {
"samsungce.surfaceResidualHeat": {
"surfaceResidualHeat": {
"value": "normal",
"timestamp": "2025-03-25T18:18:28.586Z"
}
},
"samsungce.cooktopHeatingPower": {
"manualLevel": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.586Z"
},
"heatingMode": {
"value": "manual",
"timestamp": "2025-03-25T18:18:28.586Z"
},
"manualLevelMin": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.586Z"
},
"supportedHeatingModes": {
"value": ["manual", "boost", "keepWarm"],
"timestamp": "2025-03-25T18:18:28.586Z"
},
"manualLevelMax": {
"value": 15,
"timestamp": "2025-03-25T18:18:28.586Z"
}
},
"samsungce.countDownTimer": {
"startValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.586Z"
},
"currentValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.591Z"
},
"status": {
"value": null
}
}
},
"burner-04": {
"samsungce.surfaceResidualHeat": {
"surfaceResidualHeat": {
"value": "normal",
"timestamp": "2025-03-25T18:18:28.578Z"
}
},
"samsungce.cooktopHeatingPower": {
"manualLevel": {
"value": 0,
"timestamp": "2025-03-25T18:49:25.153Z"
},
"heatingMode": {
"value": "manual",
"timestamp": "2025-03-25T18:18:28.578Z"
},
"manualLevelMin": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.578Z"
},
"supportedHeatingModes": {
"value": ["manual", "boost", "keepWarm"],
"timestamp": "2025-03-25T18:18:28.578Z"
},
"manualLevelMax": {
"value": 15,
"timestamp": "2025-03-25T18:18:28.578Z"
}
},
"samsungce.countDownTimer": {
"startValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.586Z"
},
"currentValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.586Z"
},
"status": {
"value": "idle",
"timestamp": "2025-03-25T18:18:28.578Z"
}
}
},
"burner-03": {
"samsungce.surfaceResidualHeat": {
"surfaceResidualHeat": {
"value": "normal",
"timestamp": "2025-03-25T18:18:28.550Z"
}
},
"samsungce.cooktopHeatingPower": {
"manualLevel": {
"value": 0,
"timestamp": "2025-03-26T07:27:58.652Z"
},
"heatingMode": {
"value": "manual",
"timestamp": "2025-03-25T18:18:28.550Z"
},
"manualLevelMin": {
"value": 0,
"timestamp": "2025-03-25T18:18:28.550Z"
},
"supportedHeatingModes": {
"value": ["manual", "boost", "keepWarm"],
"timestamp": "2025-03-25T18:18:28.550Z"
},
"manualLevelMax": {
"value": 15,
"timestamp": "2025-03-25T18:18:28.550Z"
}
},
"samsungce.countDownTimer": {
"startValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.550Z"
},
"currentValue": {
"value": 0,
"unit": "min",
"timestamp": "2025-03-25T18:18:28.550Z"
},
"status": {
"value": "idle",
"timestamp": "2025-03-25T18:18:28.550Z"
}
}
}
}
}

View File

@ -0,0 +1,277 @@
{
"items": [
{
"deviceId": "808dbd84-f357-47e2-a0cd-3b66fa22d584",
"name": "Builtin Cooktop",
"label": "Induction Hob",
"manufacturerName": "0A4H",
"presentationId": "DA-KS-COOKTOP-31001",
"deviceManufacturerCode": "0A4H",
"locationId": "7d27161a-0ef6-4294-91a0-80054ea5bc59",
"ownerId": "d52fb883-0f76-f4d9-0f6a-7ec2c0987b11",
"roomId": "afe14ff1-d444-420d-a766-4dd52f3e1c71",
"deviceTypeId": "Cooktop",
"deviceTypeName": "Samsung Cooktop",
"components": [
{
"id": "main",
"label": "main",
"capabilities": [
{
"id": "healthCheck",
"version": 1
},
{
"id": "switch",
"version": 1
},
{
"id": "audioMute",
"version": 1
},
{
"id": "custom.disabledComponents",
"version": 1
},
{
"id": "custom.userNotification",
"version": 1
},
{
"id": "custom.cooktopOperatingState",
"version": 1
},
{
"id": "samsungce.deviceIdentification",
"version": 1
},
{
"id": "samsungce.kitchenDeviceIdentification",
"version": 1
},
{
"id": "samsungce.softwareVersion",
"version": 1
},
{
"id": "samsungce.softwareUpdate",
"version": 1
},
{
"id": "samsungce.errorAndAlarmState",
"version": 1
},
{
"id": "samsungce.remoteManagementData",
"version": 1
},
{
"id": "samsungce.kidsLockControl",
"version": 1
},
{
"id": "samsungce.cooktopFlexZone",
"version": 1
}
],
"categories": [
{
"name": "Cooktop",
"categoryType": "manufacturer"
}
]
},
{
"id": "burner-01",
"label": "burner-01",
"capabilities": [
{
"id": "samsungce.surfaceResidualHeat",
"version": 1
},
{
"id": "samsungce.cooktopHeatingPower",
"version": 1
},
{
"id": "samsungce.countDownTimer",
"version": 1
}
],
"categories": [
{
"name": "Other",
"categoryType": "manufacturer"
}
]
},
{
"id": "burner-02",
"label": "burner-02",
"capabilities": [
{
"id": "samsungce.surfaceResidualHeat",
"version": 1
},
{
"id": "samsungce.cooktopHeatingPower",
"version": 1
},
{
"id": "samsungce.countDownTimer",
"version": 1
}
],
"categories": [
{
"name": "Other",
"categoryType": "manufacturer"
}
]
},
{
"id": "burner-03",
"label": "burner-03",
"capabilities": [
{
"id": "samsungce.surfaceResidualHeat",
"version": 1
},
{
"id": "samsungce.cooktopHeatingPower",
"version": 1
},
{
"id": "samsungce.countDownTimer",
"version": 1
}
],
"categories": [
{
"name": "Other",
"categoryType": "manufacturer"
}
]
},
{
"id": "burner-04",
"label": "burner-04",
"capabilities": [
{
"id": "samsungce.surfaceResidualHeat",
"version": 1
},
{
"id": "samsungce.cooktopHeatingPower",
"version": 1
},
{
"id": "samsungce.countDownTimer",
"version": 1
}
],
"categories": [
{
"name": "Other",
"categoryType": "manufacturer"
}
]
},
{
"id": "burner-05",
"label": "burner-05",
"capabilities": [
{
"id": "samsungce.surfaceResidualHeat",
"version": 1
},
{
"id": "samsungce.cooktopHeatingPower",
"version": 1
},
{
"id": "samsungce.countDownTimer",
"version": 1
}
],
"categories": [
{
"name": "Other",
"categoryType": "manufacturer"
}
]
},
{
"id": "burner-06",
"label": "burner-06",
"capabilities": [
{
"id": "samsungce.surfaceResidualHeat",
"version": 1
},
{
"id": "samsungce.cooktopHeatingPower",
"version": 1
},
{
"id": "samsungce.countDownTimer",
"version": 1
}
],
"categories": [
{
"name": "Other",
"categoryType": "manufacturer"
}
]
},
{
"id": "hood",
"label": "hood",
"capabilities": [
{
"id": "switch",
"version": 1
},
{
"id": "samsungce.connectionState",
"version": 1
},
{
"id": "samsungce.hoodFanSpeed",
"version": 1
},
{
"id": "samsungce.lamp",
"version": 1
},
{
"id": "samsungce.countDownTimer",
"version": 1
}
],
"categories": [
{
"name": "Other",
"categoryType": "manufacturer"
}
]
}
],
"createTime": "2025-03-25T18:18:23.576Z",
"profile": {
"id": "a99bbcb8-51c9-468d-b9d5-0ce6dca09d5a"
},
"mqtt": {
"executingLocally": false,
"transferCandidate": false
},
"type": "MQTT",
"restrictionTier": 0,
"allowed": null,
"executionContext": "CLOUD",
"relationships": []
}
],
"_links": {}
}

View File

@ -143,6 +143,54 @@
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_cooktop_31001][binary_sensor.induction_hob_power-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.induction_hob_power',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.POWER: 'power'>,
'original_icon': None,
'original_name': 'Power',
'platform': 'smartthings',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '808dbd84-f357-47e2-a0cd-3b66fa22d584_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[da_ks_cooktop_31001][binary_sensor.induction_hob_power-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'power',
'friendly_name': 'Induction Hob Power',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.induction_hob_power',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_microwave_0101x][binary_sensor.microwave_child_lock-entry]
EntityRegistryEntrySnapshot({
'aliases': set({

View File

@ -431,6 +431,39 @@
'via_device_id': None,
})
# ---
# name: test_devices[da_ks_cooktop_31001]
DeviceRegistryEntrySnapshot({
'area_id': None,
'config_entries': <ANY>,
'config_entries_subentries': <ANY>,
'configuration_url': 'https://account.smartthings.com',
'connections': set({
}),
'disabled_by': None,
'entry_type': None,
'hw_version': None,
'id': <ANY>,
'identifiers': set({
tuple(
'smartthings',
'808dbd84-f357-47e2-a0cd-3b66fa22d584',
),
}),
'is_new': False,
'labels': set({
}),
'manufacturer': None,
'model': None,
'model_id': None,
'name': 'Induction Hob',
'name_by_user': None,
'primary_config_entry': <ANY>,
'serial_number': None,
'suggested_area': None,
'sw_version': None,
'via_device_id': None,
})
# ---
# name: test_devices[da_ks_microwave_0101x]
DeviceRegistryEntrySnapshot({
'area_id': 'theater',

View File

@ -46,6 +46,53 @@
'state': 'on',
})
# ---
# name: test_all_entities[da_ks_cooktop_31001][switch.induction_hob-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.induction_hob',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'smartthings',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '808dbd84-f357-47e2-a0cd-3b66fa22d584_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[da_ks_cooktop_31001][switch.induction_hob-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Induction Hob',
}),
'context': <ANY>,
'entity_id': 'switch.induction_hob',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_all_entities[da_ks_microwave_0101x][switch.microwave-entry]
EntityRegistryEntrySnapshot({
'aliases': set({