Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add semi-professional washing machines #549

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions custom_components/miele/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
TEST_ACTION_21,
TEST_ACTION_23,
TEST_DATA_1,
TEST_DATA_3,
TEST_DATA_4,
TEST_DATA_7,
TEST_DATA_12,
Expand Down Expand Up @@ -174,6 +175,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if not coordinator.last_update_success:
await coordinator.async_config_entry_first_refresh()
serialnumbers = list(coordinator.data.keys())
if len(serialnumbers) == 0:
_LOGGER.warning("No devices found in API for this account")
else:
_LOGGER.debug("Miele devices in API account: %s", serialnumbers)

miele_api = hass.data[DOMAIN][entry.entry_id][API]
for serial in serialnumbers:
Expand Down Expand Up @@ -204,6 +209,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

async def _callback_update_data(data) -> None:
# data["1223001"] = TEST_DATA_1
# data["1223003"] = TEST_DATA_3
# data["1223004"] = TEST_DATA_4
# data["1223007"] = TEST_DATA_7
# data["1223012"] = TEST_DATA_12
Expand Down Expand Up @@ -290,6 +296,7 @@ async def async_fetch():
hass.data[DOMAIN][entry.entry_id]["retries_401"] = 0
flat_result: dict = {}
# result["1223001"] = TEST_DATA_1
# result["1223003"] = TEST_DATA_3
# result["1223004"] = TEST_DATA_4
# result["1223007"] = TEST_DATA_7
# result["1223012"] = TEST_DATA_12
Expand Down
6 changes: 6 additions & 0 deletions custom_components/miele/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class MieleBinarySensorDefinition:
MieleBinarySensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -78,6 +79,7 @@ class MieleBinarySensorDefinition:
MieleBinarySensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -113,6 +115,7 @@ class MieleBinarySensorDefinition:
MieleBinarySensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -152,6 +155,7 @@ class MieleBinarySensorDefinition:
MieleBinarySensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -188,6 +192,7 @@ class MieleBinarySensorDefinition:
MieleBinarySensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -224,6 +229,7 @@ class MieleBinarySensorDefinition:
MieleBinarySensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down
2 changes: 2 additions & 0 deletions custom_components/miele/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class MieleButtonDefinition:
MieleButtonDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand All @@ -73,6 +74,7 @@ class MieleButtonDefinition:
MieleButtonDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down
87 changes: 87 additions & 0 deletions custom_components/miele/devcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,93 @@
},
}

TEST_DATA_3 = {
"ident": {
"type": {
"key_localized": "Device type",
"value_raw": 3,
"value_localized": "",
},
"deviceName": "",
"protocolVersion": 4,
"deviceIdentLabel": {
"fabNumber": "<fabnumber03>",
"fabIndex": "00",
"techType": "PWM507",
"matNumber": "",
"swids": ["000"],
},
"xkmIdentLabel": {
"techType": "EK037",
"releaseVersion": "03.94",
},
},
"state": {
"ProgramID": {
"value_raw": 0,
"value_localized": "",
"key_localized": "Program name",
},
"status": {
"value_raw": 1,
"value_localized": "Off",
"key_localized": "status",
},
"programType": {
"value_raw": 0,
"value_localized": "",
"key_localized": "Program type",
},
"programPhase": {
"value_raw": 0,
"value_localized": "",
"key_localized": "Program phase",
},
"remainingTime": [0, 0],
"startTime": [0, 0],
"targetTemperature": [
{"value_raw": -32768, "value_localized": None, "unit": "Celsius"},
{"value_raw": -32768, "value_localized": None, "unit": "Celsius"},
{"value_raw": -32768, "value_localized": None, "unit": "Celsius"},
],
"temperature": [
{"value_raw": 2500, "value_localized": 25.0, "unit": "Celsius"},
{"value_raw": -32768, "value_localized": None, "unit": "Celsius"},
{"value_raw": -32768, "value_localized": None, "unit": "Celsius"},
],
"signalInfo": False,
"signalFailure": False,
"signalDoor": True,
"remoteEnable": {
"fullRemoteControl": True,
"smartGrid": False,
"mobileStart": False,
},
"ambientLight": None,
"light": None,
"elapsedTime": [0, 0],
"spinningSpeed": {
"unit": "rpm",
"value_raw": None,
"value_localized": None,
"key_localized": "Spin speed",
},
"dryingStep": {
"value_raw": None,
"value_localized": "",
"key_localized": "Drying level",
},
"ventilationStep": {
"value_raw": None,
"value_localized": "",
"key_localized": "Fan level",
},
"plateStep": [],
"ecoFeedback": None,
"batteryLevel": None,
},
}

TEST_DATA_4 = {
"ident": {
"type": {
Expand Down
11 changes: 11 additions & 0 deletions custom_components/miele/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -315,6 +316,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -345,6 +347,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -375,6 +378,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -404,6 +408,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.WASHER_DRYER,
],
description=MieleSensorDescription(
Expand Down Expand Up @@ -435,6 +440,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -462,6 +468,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -492,6 +499,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -519,6 +527,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -613,6 +622,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down Expand Up @@ -649,6 +659,7 @@ class MieleSensorDefinition:
MieleSensorDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down
1 change: 1 addition & 0 deletions custom_components/miele/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class MieleSwitchDefinition:
MieleSwitchDefinition(
types=[
MieleAppliance.WASHING_MACHINE,
MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL,
MieleAppliance.TUMBLE_DRYER,
MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL,
MieleAppliance.DISHWASHER,
Expand Down
Loading