diff --git a/LICENSE b/LICENSE index 2f1db63..1637db2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Andrew Marks +Copyright (c) 2021 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 60b77f6..e8cb73f 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,19 @@ -# GE Kitchen Appliances (SmartHQ) - -## `ge_kitchen` -Integration for GE WiFi-enabled kitchen appliances. So far, I've only done fridges and ovens (because that's what I -have), but I hope to to dishwashers next. Because HA doesn't have Fridge or Oven platforms, both fridges and ovens are -primarily represented as water heater entities, which works surprisingly well. If anybody who has other GE appliances -sees this and wants to pitch in, please shoot me a message or make a PR. - -Entities card: - -![Entities](https://raw.githubusercontent.com/ajmarks/ha_components/master/img/appliance_entities.png) - -Fridge Controls: - -![Fridge controls](https://raw.githubusercontent.com/ajmarks/ha_components/master/img/fridge_control.png) - -Oven Controls: - -![Fridge controls](https://raw.githubusercontent.com/ajmarks/ha_components/master/img/oven_controls.png) - +# GE Home Appliances (SmartHQ) + +## `ge_home` +Integration for GE WiFi-enabled appliances into Home Assistant. This integration currently contains fridge, oven, dishwasher, laundry washer, laundry dryer support. + +**Forked from Andrew Mark's [repository](https://github.com/ajmarks/ha_components).** + +Entities card: + +![Entities](https://raw.githubusercontent.com/simbaja/ha_components/master/img/appliance_entities.png) + +Fridge Controls: + +![Fridge controls](https://raw.githubusercontent.com/simbaja/ha_components/master/img/fridge_control.png) + +Oven Controls: + +![Fridge controls](https://raw.githubusercontent.com/simbaja/ha_components/master/img/oven_controls.png) + diff --git a/custom_components/ge_kitchen/__init__.py b/custom_components/ge_home/__init__.py similarity index 76% rename from custom_components/ge_kitchen/__init__.py rename to custom_components/ge_home/__init__.py index 9fce3a0..b9e6949 100644 --- a/custom_components/ge_kitchen/__init__.py +++ b/custom_components/ge_home/__init__.py @@ -1,4 +1,4 @@ -"""The ge_kitchen integration.""" +"""The ge_home integration.""" from homeassistant.const import EVENT_HOMEASSISTANT_STOP import voluptuous as vol @@ -8,7 +8,7 @@ from homeassistant.core import HomeAssistant from .const import ( DOMAIN ) -from .update_coordinator import GeKitchenUpdateCoordinator +from .update_coordinator import GeHomeUpdateCoordinator CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA) @@ -16,11 +16,11 @@ async def async_setup(hass: HomeAssistant, config: dict): return True async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): - """Set up the ge_kitchen component.""" + """Set up the ge_home component.""" hass.data.setdefault(DOMAIN, {}) - """Set up ge_kitchen from a config entry.""" - coordinator = GeKitchenUpdateCoordinator(hass, entry) + """Set up ge_home from a config entry.""" + coordinator = GeHomeUpdateCoordinator(hass, entry) hass.data[DOMAIN][entry.entry_id] = coordinator if not await coordinator.async_setup(): @@ -32,7 +32,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): """Unload a config entry.""" - coordinator: GeKitchenUpdateCoordinator = hass.data[DOMAIN][entry.entry_id] + coordinator: GeHomeUpdateCoordinator = hass.data[DOMAIN][entry.entry_id] ok = await coordinator.async_reset() if ok: hass.data[DOMAIN].pop(entry.entry_id) diff --git a/custom_components/ge_kitchen/binary_sensor.py b/custom_components/ge_home/binary_sensor.py similarity index 82% rename from custom_components/ge_kitchen/binary_sensor.py rename to custom_components/ge_home/binary_sensor.py index 6068fa1..addce09 100644 --- a/custom_components/ge_kitchen/binary_sensor.py +++ b/custom_components/ge_home/binary_sensor.py @@ -1,4 +1,4 @@ -"""GE Kitchen Sensor Entities""" +"""GE Home Sensor Entities""" import async_timeout import logging from typing import Callable @@ -9,14 +9,14 @@ from homeassistant.core import HomeAssistant from .const import DOMAIN from .entities import GeErdBinarySensor -from .update_coordinator import GeKitchenUpdateCoordinator +from .update_coordinator import GeHomeUpdateCoordinator _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable): - """GE Kitchen sensors.""" + """GE Home sensors.""" - coordinator: GeKitchenUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] + coordinator: GeHomeUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] # This should be a NOP, but let's be safe with async_timeout.timeout(20): diff --git a/custom_components/ge_kitchen/config_flow.py b/custom_components/ge_home/config_flow.py similarity index 86% rename from custom_components/ge_kitchen/config_flow.py rename to custom_components/ge_home/config_flow.py index 3d93d22..b272f07 100644 --- a/custom_components/ge_kitchen/config_flow.py +++ b/custom_components/ge_home/config_flow.py @@ -1,4 +1,4 @@ -"""Config flow for GE Kitchen integration.""" +"""Config flow for GE Home integration.""" import logging from typing import Dict, Optional @@ -7,7 +7,7 @@ import aiohttp import asyncio import async_timeout -from gekitchensdk import GeAuthFailedError, GeNotAuthenticatedError, GeGeneralServerError, async_get_oauth2_token +from gehomesdk import GeAuthFailedError, GeNotAuthenticatedError, GeGeneralServerError, async_get_oauth2_token import voluptuous as vol from homeassistant import config_entries, core @@ -18,7 +18,7 @@ from .exceptions import HaAuthError, HaCannotConnect _LOGGER = logging.getLogger(__name__) -GEKITCHEN_SCHEMA = vol.Schema( +GEHOME_SCHEMA = vol.Schema( {vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str} ) @@ -42,10 +42,10 @@ async def validate_input(hass: core.HomeAssistant, data): raise HaCannotConnect('Unknown connection failure') # Return info that you want to store in the config entry. - return {"title": f"GE Kitchen ({data[CONF_USERNAME]:s})"} + return {"title": f"GE Home ({data[CONF_USERNAME]:s})"} -class GeKitchenConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): - """Handle a config flow for GE Kitchen.""" +class GeHomeConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): + """Handle a config flow for GE Home.""" VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_PUSH @@ -77,7 +77,7 @@ class GeKitchenConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return self.async_create_entry(title=info["title"], data=user_input) return self.async_show_form( - step_id="user", data_schema=GEKITCHEN_SCHEMA, errors=errors + step_id="user", data_schema=GEHOME_SCHEMA, errors=errors ) async def async_step_reauth(self, user_input: Optional[dict] = None): @@ -100,5 +100,5 @@ class GeKitchenConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return self.async_abort(reason=errors["base"]) return self.async_show_form( - step_id="reauth", data_schema=GEKITCHEN_SCHEMA, errors=errors, + step_id="reauth", data_schema=GEHOME_SCHEMA, errors=errors, ) diff --git a/custom_components/ge_kitchen/const.py b/custom_components/ge_home/const.py similarity index 57% rename from custom_components/ge_kitchen/const.py rename to custom_components/ge_home/const.py index 0076de8..87fe381 100644 --- a/custom_components/ge_kitchen/const.py +++ b/custom_components/ge_home/const.py @@ -1,7 +1,7 @@ -"""Constants for the ge_kitchen integration.""" -from gekitchensdk.clients.const import LOGIN_URL +"""Constants for the gehome integration.""" +from gehomesdk.clients.const import LOGIN_URL -DOMAIN = "ge_kitchen" +DOMAIN = "ge_home" EVENT_ALL_APPLIANCES_READY = 'all_appliances_ready' diff --git a/custom_components/ge_kitchen/devices/__init__.py b/custom_components/ge_home/devices/__init__.py similarity index 95% rename from custom_components/ge_kitchen/devices/__init__.py rename to custom_components/ge_home/devices/__init__.py index a3083a1..3d300a3 100644 --- a/custom_components/ge_kitchen/devices/__init__.py +++ b/custom_components/ge_home/devices/__init__.py @@ -1,7 +1,7 @@ import logging from typing import Type -from gekitchensdk.erd import ErdApplianceType +from gehomesdk.erd import ErdApplianceType from .base import ApplianceApi from .oven import OvenApi diff --git a/custom_components/ge_kitchen/devices/base.py b/custom_components/ge_home/devices/base.py similarity index 97% rename from custom_components/ge_kitchen/devices/base.py rename to custom_components/ge_home/devices/base.py index 3bcb57c..d343340 100644 --- a/custom_components/ge_kitchen/devices/base.py +++ b/custom_components/ge_home/devices/base.py @@ -2,8 +2,8 @@ import asyncio import logging from typing import Dict, List, Optional -from gekitchensdk import GeAppliance -from gekitchensdk.erd import ErdCode, ErdCodeType, ErdApplianceType +from gehomesdk import GeAppliance +from gehomesdk.erd import ErdCode, ErdCodeType, ErdApplianceType from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import Entity diff --git a/custom_components/ge_kitchen/devices/dishwasher.py b/custom_components/ge_home/devices/dishwasher.py similarity index 94% rename from custom_components/ge_kitchen/devices/dishwasher.py rename to custom_components/ge_home/devices/dishwasher.py index 1221432..e9a8632 100644 --- a/custom_components/ge_kitchen/devices/dishwasher.py +++ b/custom_components/ge_home/devices/dishwasher.py @@ -2,7 +2,7 @@ import logging from typing import List from homeassistant.helpers.entity import Entity -from gekitchensdk.erd import ErdCode, ErdApplianceType +from gehomesdk.erd import ErdCode, ErdApplianceType from .base import ApplianceApi from ..entities import GeErdSensor, GeDishwasherControlLockedSwitch @@ -28,4 +28,4 @@ class DishwasherApi(ApplianceApi): ] entities = base_entities + dishwasher_entities return entities - \ No newline at end of file + diff --git a/custom_components/ge_kitchen/devices/dryer.py b/custom_components/ge_home/devices/dryer.py similarity index 95% rename from custom_components/ge_kitchen/devices/dryer.py rename to custom_components/ge_home/devices/dryer.py index 8a231a8..2876464 100644 --- a/custom_components/ge_kitchen/devices/dryer.py +++ b/custom_components/ge_home/devices/dryer.py @@ -2,7 +2,7 @@ import logging from typing import List from homeassistant.helpers.entity import Entity -from gekitchensdk.erd import ErdCode, ErdApplianceType +from gehomesdk.erd import ErdCode, ErdApplianceType from .base import ApplianceApi from ..entities import GeErdSensor, GeDishwasherControlLockedSwitch diff --git a/custom_components/ge_kitchen/devices/fridge.py b/custom_components/ge_home/devices/fridge.py similarity index 99% rename from custom_components/ge_kitchen/devices/fridge.py rename to custom_components/ge_home/devices/fridge.py index 3c888f1..10f17b4 100644 --- a/custom_components/ge_kitchen/devices/fridge.py +++ b/custom_components/ge_home/devices/fridge.py @@ -4,7 +4,7 @@ import logging from typing import List from homeassistant.helpers.entity import Entity -from gekitchensdk import ( +from gehomesdk import ( ErdCode, ErdApplianceType, ErdOnOff, diff --git a/custom_components/ge_kitchen/devices/oven.py b/custom_components/ge_home/devices/oven.py similarity index 99% rename from custom_components/ge_kitchen/devices/oven.py rename to custom_components/ge_home/devices/oven.py index afe0981..1e0c84d 100644 --- a/custom_components/ge_kitchen/devices/oven.py +++ b/custom_components/ge_home/devices/oven.py @@ -3,7 +3,7 @@ from typing import List from homeassistant.const import DEVICE_CLASS_POWER_FACTOR from homeassistant.helpers.entity import Entity -from gekitchensdk import ( +from gehomesdk import ( ErdCode, ErdApplianceType, OvenConfiguration, diff --git a/custom_components/ge_kitchen/devices/washer.py b/custom_components/ge_home/devices/washer.py similarity index 89% rename from custom_components/ge_kitchen/devices/washer.py rename to custom_components/ge_home/devices/washer.py index 11f325a..53b1d74 100644 --- a/custom_components/ge_kitchen/devices/washer.py +++ b/custom_components/ge_home/devices/washer.py @@ -1,9 +1,9 @@ -from custom_components.ge_kitchen.entities.common.ge_erd_binary_sensor import GeErdBinarySensor +from custom_components.ge_home.entities.common.ge_erd_binary_sensor import GeErdBinarySensor import logging from typing import List from homeassistant.helpers.entity import Entity -from gekitchensdk.erd import ErdCode, ErdApplianceType +from gehomesdk.erd import ErdCode, ErdApplianceType from .base import ApplianceApi from ..entities import GeErdSensor, GeErdBinarySensor @@ -35,4 +35,4 @@ class WasherApi(ApplianceApi): ] entities = base_entities + washer_entities return entities - \ No newline at end of file + diff --git a/custom_components/ge_kitchen/devices/washer_dryer.py b/custom_components/ge_home/devices/washer_dryer.py similarity index 95% rename from custom_components/ge_kitchen/devices/washer_dryer.py rename to custom_components/ge_home/devices/washer_dryer.py index 86789df..5b3d720 100644 --- a/custom_components/ge_kitchen/devices/washer_dryer.py +++ b/custom_components/ge_home/devices/washer_dryer.py @@ -2,7 +2,7 @@ import logging from typing import List from homeassistant.helpers.entity import Entity -from gekitchensdk.erd import ErdCode, ErdApplianceType +from gehomesdk.erd import ErdCode, ErdApplianceType from .base import ApplianceApi from ..entities import GeErdSensor, GeErdBinarySensor @@ -38,4 +38,4 @@ class WasherDryerApi(ApplianceApi): ] entities = base_entities + washer_entities + dryer_entities return entities - \ No newline at end of file + diff --git a/custom_components/ge_kitchen/entities/__init__.py b/custom_components/ge_home/entities/__init__.py similarity index 100% rename from custom_components/ge_kitchen/entities/__init__.py rename to custom_components/ge_home/entities/__init__.py diff --git a/custom_components/ge_kitchen/entities/common/__init__.py b/custom_components/ge_home/entities/common/__init__.py similarity index 100% rename from custom_components/ge_kitchen/entities/common/__init__.py rename to custom_components/ge_home/entities/common/__init__.py diff --git a/custom_components/ge_kitchen/entities/common/ge_entity.py b/custom_components/ge_home/entities/common/ge_entity.py similarity index 96% rename from custom_components/ge_kitchen/entities/common/ge_entity.py rename to custom_components/ge_home/entities/common/ge_entity.py index e8c04db..ed9e090 100644 --- a/custom_components/ge_kitchen/entities/common/ge_entity.py +++ b/custom_components/ge_home/entities/common/ge_entity.py @@ -1,7 +1,7 @@ from datetime import timedelta from typing import Optional, Dict, Any -from gekitchensdk import GeAppliance +from gehomesdk import GeAppliance from ...devices import ApplianceApi class GeEntity: @@ -62,4 +62,4 @@ class GeEntity: return None def _get_device_class(self) -> Optional[str]: - return None \ No newline at end of file + return None diff --git a/custom_components/ge_kitchen/entities/common/ge_erd_binary_sensor.py b/custom_components/ge_home/entities/common/ge_erd_binary_sensor.py similarity index 96% rename from custom_components/ge_kitchen/entities/common/ge_erd_binary_sensor.py rename to custom_components/ge_home/entities/common/ge_erd_binary_sensor.py index e02c298..8c6f613 100644 --- a/custom_components/ge_kitchen/entities/common/ge_erd_binary_sensor.py +++ b/custom_components/ge_home/entities/common/ge_erd_binary_sensor.py @@ -2,7 +2,7 @@ from typing import Optional from homeassistant.components.binary_sensor import BinarySensorEntity -from gekitchensdk import ErdCode, ErdCodeType, ErdCodeClass +from gehomesdk import ErdCode, ErdCodeType, ErdCodeClass from ...devices import ApplianceApi from .ge_erd_entity import GeErdEntity diff --git a/custom_components/ge_kitchen/entities/common/ge_erd_entity.py b/custom_components/ge_home/entities/common/ge_erd_entity.py similarity index 98% rename from custom_components/ge_kitchen/entities/common/ge_erd_entity.py rename to custom_components/ge_home/entities/common/ge_erd_entity.py index a32d66e..eae8995 100644 --- a/custom_components/ge_kitchen/entities/common/ge_erd_entity.py +++ b/custom_components/ge_home/entities/common/ge_erd_entity.py @@ -2,7 +2,7 @@ from datetime import timedelta from typing import Optional from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT -from gekitchensdk import ErdCode, ErdCodeType, ErdCodeClass, ErdMeasurementUnits +from gehomesdk import ErdCode, ErdCodeType, ErdCodeClass, ErdMeasurementUnits from ...const import DOMAIN from ...devices import ApplianceApi diff --git a/custom_components/ge_kitchen/entities/common/ge_erd_property_binary_sensor.py b/custom_components/ge_home/entities/common/ge_erd_property_binary_sensor.py similarity index 97% rename from custom_components/ge_kitchen/entities/common/ge_erd_property_binary_sensor.py rename to custom_components/ge_home/entities/common/ge_erd_property_binary_sensor.py index 8f6a425..d7504ce 100644 --- a/custom_components/ge_kitchen/entities/common/ge_erd_property_binary_sensor.py +++ b/custom_components/ge_home/entities/common/ge_erd_property_binary_sensor.py @@ -1,7 +1,7 @@ from typing import Optional import magicattr -from gekitchensdk import ErdCodeType +from gehomesdk import ErdCodeType from ...devices import ApplianceApi from .ge_erd_binary_sensor import GeErdBinarySensor diff --git a/custom_components/ge_kitchen/entities/common/ge_erd_property_sensor.py b/custom_components/ge_home/entities/common/ge_erd_property_sensor.py similarity index 94% rename from custom_components/ge_kitchen/entities/common/ge_erd_property_sensor.py rename to custom_components/ge_home/entities/common/ge_erd_property_sensor.py index 5e9b0ee..0092d42 100644 --- a/custom_components/ge_kitchen/entities/common/ge_erd_property_sensor.py +++ b/custom_components/ge_home/entities/common/ge_erd_property_sensor.py @@ -1,7 +1,7 @@ from typing import Optional import magicattr -from gekitchensdk import ErdCode, ErdCodeType, ErdMeasurementUnits +from gehomesdk import ErdCode, ErdCodeType, ErdMeasurementUnits from ...devices import ApplianceApi from .ge_erd_sensor import GeErdSensor diff --git a/custom_components/ge_kitchen/entities/common/ge_erd_sensor.py b/custom_components/ge_home/entities/common/ge_erd_sensor.py similarity index 97% rename from custom_components/ge_kitchen/entities/common/ge_erd_sensor.py rename to custom_components/ge_home/entities/common/ge_erd_sensor.py index 513d4ae..cdeee95 100644 --- a/custom_components/ge_kitchen/entities/common/ge_erd_sensor.py +++ b/custom_components/ge_home/entities/common/ge_erd_sensor.py @@ -8,7 +8,7 @@ from homeassistant.const import ( TEMP_FAHRENHEIT ) from homeassistant.helpers.entity import Entity -from gekitchensdk import ErdCode, ErdCodeClass, ErdMeasurementUnits +from gehomesdk import ErdCode, ErdCodeClass, ErdMeasurementUnits from .ge_erd_entity import GeErdEntity diff --git a/custom_components/ge_kitchen/entities/common/ge_erd_switch.py b/custom_components/ge_home/entities/common/ge_erd_switch.py similarity index 100% rename from custom_components/ge_kitchen/entities/common/ge_erd_switch.py rename to custom_components/ge_home/entities/common/ge_erd_switch.py diff --git a/custom_components/ge_kitchen/entities/common/ge_water_heater.py b/custom_components/ge_home/entities/common/ge_water_heater.py similarity index 96% rename from custom_components/ge_kitchen/entities/common/ge_water_heater.py rename to custom_components/ge_home/entities/common/ge_water_heater.py index 180a134..a99b6c6 100644 --- a/custom_components/ge_kitchen/entities/common/ge_water_heater.py +++ b/custom_components/ge_home/entities/common/ge_water_heater.py @@ -7,7 +7,7 @@ from homeassistant.const import ( TEMP_FAHRENHEIT, TEMP_CELSIUS ) -from gekitchensdk import ErdCode, ErdMeasurementUnits +from gehomesdk import ErdCode, ErdMeasurementUnits from ...const import DOMAIN from .ge_erd_entity import GeEntity diff --git a/custom_components/ge_kitchen/entities/dishwasher/__init__.py b/custom_components/ge_home/entities/dishwasher/__init__.py similarity index 100% rename from custom_components/ge_kitchen/entities/dishwasher/__init__.py rename to custom_components/ge_home/entities/dishwasher/__init__.py diff --git a/custom_components/ge_kitchen/entities/dishwasher/ge_dishwasher_control_locked_switch.py b/custom_components/ge_home/entities/dishwasher/ge_dishwasher_control_locked_switch.py similarity index 88% rename from custom_components/ge_kitchen/entities/dishwasher/ge_dishwasher_control_locked_switch.py rename to custom_components/ge_home/entities/dishwasher/ge_dishwasher_control_locked_switch.py index 29bae93..55923d8 100644 --- a/custom_components/ge_kitchen/entities/dishwasher/ge_dishwasher_control_locked_switch.py +++ b/custom_components/ge_home/entities/dishwasher/ge_dishwasher_control_locked_switch.py @@ -1,4 +1,4 @@ -from gekitchensdk import ErdCode, ErdOperatingMode +from gehomesdk import ErdCode, ErdOperatingMode from ..common import GeErdSwitch @@ -9,4 +9,4 @@ class GeDishwasherControlLockedSwitch(GeErdSwitch): def is_on(self) -> bool: mode: ErdOperatingMode = self.appliance.get_erd_value(ErdCode.OPERATING_MODE) return mode == ErdOperatingMode.CONTROL_LOCKED - \ No newline at end of file + diff --git a/custom_components/ge_kitchen/entities/fridge/__init__.py b/custom_components/ge_home/entities/fridge/__init__.py similarity index 100% rename from custom_components/ge_kitchen/entities/fridge/__init__.py rename to custom_components/ge_home/entities/fridge/__init__.py diff --git a/custom_components/ge_kitchen/entities/fridge/const.py b/custom_components/ge_home/entities/fridge/const.py similarity index 100% rename from custom_components/ge_kitchen/entities/fridge/const.py rename to custom_components/ge_home/entities/fridge/const.py diff --git a/custom_components/ge_kitchen/entities/fridge/ge_abstract_fridge.py b/custom_components/ge_home/entities/fridge/ge_abstract_fridge.py similarity index 98% rename from custom_components/ge_kitchen/entities/fridge/ge_abstract_fridge.py rename to custom_components/ge_home/entities/fridge/ge_abstract_fridge.py index f869398..06f6948 100644 --- a/custom_components/ge_kitchen/entities/fridge/ge_abstract_fridge.py +++ b/custom_components/ge_home/entities/fridge/ge_abstract_fridge.py @@ -1,4 +1,4 @@ -"""GE Kitchen Sensor Entities - Abstract Fridge""" +"""GE Home Sensor Entities - Abstract Fridge""" import sys import os import abc @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT -from gekitchensdk import ( +from gehomesdk import ( ErdCode, ErdOnOff, ErdFullNotFull, diff --git a/custom_components/ge_kitchen/entities/fridge/ge_dispenser.py b/custom_components/ge_home/entities/fridge/ge_dispenser.py similarity index 98% rename from custom_components/ge_kitchen/entities/fridge/ge_dispenser.py rename to custom_components/ge_home/entities/fridge/ge_dispenser.py index 69bf3c0..eef0e9d 100644 --- a/custom_components/ge_kitchen/entities/fridge/ge_dispenser.py +++ b/custom_components/ge_home/entities/fridge/ge_dispenser.py @@ -1,4 +1,4 @@ -"""GE Kitchen Sensor Entities - Dispenser""" +"""GE Home Sensor Entities - Dispenser""" import logging from typing import List, Optional, Dict, Any @@ -6,7 +6,7 @@ from typing import List, Optional, Dict, Any from homeassistant.const import ATTR_TEMPERATURE, TEMP_FAHRENHEIT from homeassistant.util.temperature import convert as convert_temperature -from gekitchensdk import ( +from gehomesdk import ( ErdCode, ErdHotWaterStatus, ErdPresent, diff --git a/custom_components/ge_kitchen/entities/fridge/ge_freezer.py b/custom_components/ge_home/entities/fridge/ge_freezer.py similarity index 91% rename from custom_components/ge_kitchen/entities/fridge/ge_freezer.py rename to custom_components/ge_home/entities/fridge/ge_freezer.py index 440f31d..4b178fc 100644 --- a/custom_components/ge_kitchen/entities/fridge/ge_freezer.py +++ b/custom_components/ge_home/entities/fridge/ge_freezer.py @@ -1,8 +1,8 @@ -"""GE Kitchen Sensor Entities - Freezer""" +"""GE Home Sensor Entities - Freezer""" import logging from typing import Any, Dict, Optional -from gekitchensdk import ( +from gehomesdk import ( ErdCode, ErdDoorStatus ) diff --git a/custom_components/ge_kitchen/entities/fridge/ge_fridge.py b/custom_components/ge_home/entities/fridge/ge_fridge.py similarity index 96% rename from custom_components/ge_kitchen/entities/fridge/ge_fridge.py rename to custom_components/ge_home/entities/fridge/ge_fridge.py index 457b304..42cc80e 100644 --- a/custom_components/ge_kitchen/entities/fridge/ge_fridge.py +++ b/custom_components/ge_home/entities/fridge/ge_fridge.py @@ -1,8 +1,8 @@ -"""GE Kitchen Sensor Entities - Fridge""" +"""GE Home Sensor Entities - Fridge""" import logging from typing import Any, Dict -from gekitchensdk import ( +from gehomesdk import ( ErdCode, ErdDoorStatus, ErdFilterStatus diff --git a/custom_components/ge_kitchen/entities/oven/__init__.py b/custom_components/ge_home/entities/oven/__init__.py similarity index 100% rename from custom_components/ge_kitchen/entities/oven/__init__.py rename to custom_components/ge_home/entities/oven/__init__.py diff --git a/custom_components/ge_kitchen/entities/oven/const.py b/custom_components/ge_home/entities/oven/const.py similarity index 96% rename from custom_components/ge_kitchen/entities/oven/const.py rename to custom_components/ge_home/entities/oven/const.py index 0373d9c..11bd991 100644 --- a/custom_components/ge_kitchen/entities/oven/const.py +++ b/custom_components/ge_home/entities/oven/const.py @@ -4,7 +4,7 @@ from homeassistant.components.water_heater import ( SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE ) -from gekitchensdk import ErdOvenCookMode +from gehomesdk import ErdOvenCookMode SUPPORT_NONE = 0 GE_OVEN_SUPPORT = (SUPPORT_OPERATION_MODE | SUPPORT_TARGET_TEMPERATURE) diff --git a/custom_components/ge_kitchen/entities/oven/ge_oven.py b/custom_components/ge_home/entities/oven/ge_oven.py similarity index 99% rename from custom_components/ge_kitchen/entities/oven/ge_oven.py rename to custom_components/ge_home/entities/oven/ge_oven.py index 59e103c..aefb42c 100644 --- a/custom_components/ge_kitchen/entities/oven/ge_oven.py +++ b/custom_components/ge_home/entities/oven/ge_oven.py @@ -1,8 +1,8 @@ -"""GE Kitchen Sensor Entities - Oven""" +"""GE Home Sensor Entities - Oven""" import logging from typing import Any, Dict, List, Optional, Set -from gekitchensdk import ( +from gehomesdk import ( ErdCode, ErdMeasurementUnits, ErdOvenCookMode, diff --git a/custom_components/ge_kitchen/exceptions.py b/custom_components/ge_home/exceptions.py similarity index 100% rename from custom_components/ge_kitchen/exceptions.py rename to custom_components/ge_home/exceptions.py diff --git a/custom_components/ge_home/manifest.json b/custom_components/ge_home/manifest.json new file mode 100644 index 0000000..5b668b4 --- /dev/null +++ b/custom_components/ge_home/manifest.json @@ -0,0 +1,9 @@ +{ + "domain": "ge_home", + "name": "GE Home", + "config_flow": true, + "documentation": "https://github.com/simbaja/ha_components", + "requirements": ["gehomesdk==0.3.12","magicattr==0.1.5"], + "codeowners": ["@simbaja"], + "version": "0.3.12" +} diff --git a/custom_components/ge_kitchen/sensor.py b/custom_components/ge_home/sensor.py similarity index 78% rename from custom_components/ge_kitchen/sensor.py rename to custom_components/ge_home/sensor.py index d01cdba..17a037d 100644 --- a/custom_components/ge_kitchen/sensor.py +++ b/custom_components/ge_home/sensor.py @@ -1,4 +1,4 @@ -"""GE Kitchen Sensor Entities""" +"""GE Home Sensor Entities""" import async_timeout import logging from typing import Callable @@ -8,14 +8,14 @@ from homeassistant.core import HomeAssistant from .const import DOMAIN from .entities import GeErdSensor -from .update_coordinator import GeKitchenUpdateCoordinator +from .update_coordinator import GeHomeUpdateCoordinator _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable): - """GE Kitchen sensors.""" - _LOGGER.debug('Adding GE Kitchen sensors') - coordinator: GeKitchenUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] + """GE Home sensors.""" + _LOGGER.debug('Adding GE Home sensors') + coordinator: GeHomeUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] # This should be a NOP, but let's be safe with async_timeout.timeout(20): diff --git a/custom_components/ge_kitchen/strings.json b/custom_components/ge_home/strings.json similarity index 100% rename from custom_components/ge_kitchen/strings.json rename to custom_components/ge_home/strings.json diff --git a/custom_components/ge_kitchen/switch.py b/custom_components/ge_home/switch.py similarity index 78% rename from custom_components/ge_kitchen/switch.py rename to custom_components/ge_home/switch.py index d2cf2cf..78cf896 100644 --- a/custom_components/ge_kitchen/switch.py +++ b/custom_components/ge_home/switch.py @@ -1,4 +1,4 @@ -"""GE Kitchen Switch Entities""" +"""GE Home Switch Entities""" import async_timeout import logging from typing import Callable @@ -8,14 +8,14 @@ from homeassistant.core import HomeAssistant from .entities import GeErdSwitch from .const import DOMAIN -from .update_coordinator import GeKitchenUpdateCoordinator +from .update_coordinator import GeHomeUpdateCoordinator _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable): - """GE Kitchen sensors.""" - _LOGGER.debug('Adding GE Kitchen switches') - coordinator: GeKitchenUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] + """GE Home sensors.""" + _LOGGER.debug('Adding GE Home switches') + coordinator: GeHomeUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] # This should be a NOP, but let's be safe with async_timeout.timeout(20): diff --git a/custom_components/ge_kitchen/translations/en.json b/custom_components/ge_home/translations/en.json similarity index 95% rename from custom_components/ge_kitchen/translations/en.json rename to custom_components/ge_home/translations/en.json index 142a25e..ce1c350 100644 --- a/custom_components/ge_kitchen/translations/en.json +++ b/custom_components/ge_home/translations/en.json @@ -1,5 +1,5 @@ { - "title": "GE Kitchen", + "title": "GE Home", "config": { "step": { "init": { @@ -24,4 +24,4 @@ "already_configured_account": "[%key:common::config_flow::abort::already_configured_account%]" } } -} \ No newline at end of file +} diff --git a/custom_components/ge_kitchen/update_coordinator.py b/custom_components/ge_home/update_coordinator.py similarity index 94% rename from custom_components/ge_kitchen/update_coordinator.py rename to custom_components/ge_home/update_coordinator.py index 0c4ae2d..4f1aef5 100644 --- a/custom_components/ge_kitchen/update_coordinator.py +++ b/custom_components/ge_home/update_coordinator.py @@ -1,11 +1,11 @@ -"""Data update coordinator for GE Kitchen Appliances""" +"""Data update coordinator for GE Home Appliances""" import asyncio import async_timeout import logging from typing import Any, Dict, Iterable, Optional, Tuple -from gekitchensdk import ( +from gehomesdk import ( EVENT_APPLIANCE_INITIAL_UPDATE, EVENT_APPLIANCE_UPDATE_RECEIVED, EVENT_CONNECTED, @@ -15,7 +15,7 @@ from gekitchensdk import ( GeAppliance, GeWebsocketClient, ) -from gekitchensdk import GeAuthFailedError, GeGeneralServerError, GeNotAuthenticatedError +from gehomesdk import GeAuthFailedError, GeGeneralServerError, GeNotAuthenticatedError from .exceptions import HaAuthError, HaCannotConnect from homeassistant.config_entries import ConfigEntry @@ -37,11 +37,11 @@ from .devices import ApplianceApi, get_appliance_api_type PLATFORMS = ["binary_sensor", "sensor", "switch", "water_heater"] _LOGGER = logging.getLogger(__name__) -class GeKitchenUpdateCoordinator(DataUpdateCoordinator): - """Define a wrapper class to update GE Kitchen data.""" +class GeHomeUpdateCoordinator(DataUpdateCoordinator): + """Define a wrapper class to update GE Home data.""" def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None: - """Set up the GeKitchenUpdateCoordinator class.""" + """Set up the GeHomeUpdateCoordinator class.""" self._hass = hass self._config_entry = config_entry self._username = config_entry.data[CONF_USERNAME] @@ -176,7 +176,7 @@ class GeKitchenUpdateCoordinator(DataUpdateCoordinator): raise async def async_begin_session(self): - """Begins the ge_kitchen session.""" + """Begins the ge_home session.""" _LOGGER.debug("Beginning session") session = self._hass.helpers.aiohttp_client.async_get_clientsession() await self.client.async_get_credentials(session) @@ -206,15 +206,15 @@ class GeKitchenUpdateCoordinator(DataUpdateCoordinator): @callback def reconnect(self, log=False) -> None: - """Prepare to reconnect ge_kitchen session.""" + """Prepare to reconnect ge_home session.""" if log: - _LOGGER.info("Will try to reconnect to ge_kitchen service") + _LOGGER.info("Will try to reconnect to ge_home service") self.hass.loop.create_task(self.async_reconnect()) async def async_reconnect(self) -> None: - """Try to reconnect ge_kitchen session.""" + """Try to reconnect ge_home session.""" self._retry_count += 1 - _LOGGER.info(f"attempting to reconnect to ge_kitchen service (attempt {self._retry_count})") + _LOGGER.info(f"attempting to reconnect to ge_home service (attempt {self._retry_count})") try: with async_timeout.timeout(ASYNC_TIMEOUT): @@ -233,7 +233,7 @@ class GeKitchenUpdateCoordinator(DataUpdateCoordinator): """Close the connection on shutdown. Used as an argument to EventBus.async_listen_once. """ - _LOGGER.info("ge_kitchen shutting down") + _LOGGER.info("ge_home shutting down") if self.client: self.client.clear_event_handlers() self.client.disconnect() diff --git a/custom_components/ge_kitchen/water_heater.py b/custom_components/ge_home/water_heater.py similarity index 82% rename from custom_components/ge_kitchen/water_heater.py rename to custom_components/ge_home/water_heater.py index 4fb4593..ac0aa85 100644 --- a/custom_components/ge_kitchen/water_heater.py +++ b/custom_components/ge_home/water_heater.py @@ -1,4 +1,4 @@ -"""GE Kitchen Sensor Entities""" +"""GE Home Sensor Entities""" import async_timeout import logging from typing import Callable @@ -9,14 +9,14 @@ from homeassistant.core import HomeAssistant from .entities import GeWaterHeater from .const import DOMAIN -from .update_coordinator import GeKitchenUpdateCoordinator +from .update_coordinator import GeHomeUpdateCoordinator _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable): - """GE Kitchen Water Heaters.""" + """GE Home Water Heaters.""" _LOGGER.debug('Adding GE "Water Heaters"') - coordinator: GeKitchenUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] + coordinator: GeHomeUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] # This should be a NOP, but let's be safe with async_timeout.timeout(20): diff --git a/custom_components/ge_kitchen/manifest.json b/custom_components/ge_kitchen/manifest.json deleted file mode 100644 index dc82b75..0000000 --- a/custom_components/ge_kitchen/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "domain": "ge_kitchen", - "name": "GE Kitchen", - "config_flow": true, - "documentation": "https://github.com/simbaja/ha_components", - "requirements": ["gekitchensdk==0.3.11","magicattr==0.1.5"], - "codeowners": ["@simbaja"], - "version": "0.3.11" -} diff --git a/hacs.json b/hacs.json index a9df915..2790e10 100644 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,5 @@ { - "name": "GE Kitchen Appliances (SmartHQ)", + "name": "GE Appliances (SmartHQ)", "homeassistant": "2021.1.5", "domains": ["binary_sensor", "sensor", "switch", "water_heater"], "iot_class": "Cloud Polling" diff --git a/info.md b/info.md index f8aee06..e8cb73f 100644 --- a/info.md +++ b/info.md @@ -1,20 +1,19 @@ -# GE Kitchen Appliances (SmartHQ) +# GE Home Appliances (SmartHQ) -## `ge_kitchen` -Integration for GE WiFi-enabled kitchen appliances. So far, I've only done fridges and ovens (because that's what I -have), but I hope to to dishwashers next. Because HA doesn't have Fridge or Oven platforms, both fridges and ovens are -primarily represented as water heater entities, which works surprisingly well. If anybody who has other GE appliances -sees this and wants to pitch in, please shoot me a message or make a PR. +## `ge_home` +Integration for GE WiFi-enabled appliances into Home Assistant. This integration currently contains fridge, oven, dishwasher, laundry washer, laundry dryer support. + +**Forked from Andrew Mark's [repository](https://github.com/ajmarks/ha_components).** Entities card: -![Entities](https://raw.githubusercontent.com/ajmarks/ha_components/master/img/appliance_entities.png) +![Entities](https://raw.githubusercontent.com/simbaja/ha_components/master/img/appliance_entities.png) Fridge Controls: -![Fridge controls](https://raw.githubusercontent.com/ajmarks/ha_components/master/img/fridge_control.png) +![Fridge controls](https://raw.githubusercontent.com/simbaja/ha_components/master/img/fridge_control.png) Oven Controls: -![Fridge controls](https://raw.githubusercontent.com/ajmarks/ha_components/master/img/oven_controls.png) +![Fridge controls](https://raw.githubusercontent.com/simbaja/ha_components/master/img/oven_controls.png)