Home connect functional and ambient light added (#44091)

* Update nl.json

* added period to end of every logging entry.

* Functional and ambient light added

* Change to dict.get method

* Update light.py

* Update __init__.py

Platforms sorted 🔡.

* Update api.py

- Removed all none light platform related changes.
- Period removed from loggin.
- Storing entities removed.
- Not needed formating change reverted.
-

* Update const.py

All words seperated with underscore.

* Update nl.json

Reverted change on translation file.

* Update light.py

-All words of constants seperated with underscore.
- f-string used iso concatenation.
- Added "ambient"to loggin text.
- Removed self._state = false when color setting did not succeed.
- Logging starts with a capital.

* Update api.py

- Removed ending perio in logging
- Reverted formating
- Removed self.device.entities.append(self)
-

* Update entity.py

- Removed self.device.entities.append(self)

* Update api.py

- Adding newline at end of file
- Added whitespave after ","

* Update api.py

Newline at end of file

* Update const.py

Removed unused.

* Update light.py

- seperated words with whitespaces
- improved debug text

* Update light.py

remove state setting after an error
This commit is contained in:
Sjack-Sch 2020-12-19 23:40:44 +01:00 committed by GitHub
parent 4f088dd77a
commit 00c0e9b8da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 249 additions and 4 deletions

View file

@ -168,6 +168,30 @@ class DeviceWithDoor(HomeConnectDevice):
}
class DeviceWithLight(HomeConnectDevice):
"""Device that has lighting."""
def get_light_entity(self):
"""Get a dictionary with info about the lighting."""
return {
"device": self,
"desc": "Light",
"ambient": None,
}
class DeviceWithAmbientLight(HomeConnectDevice):
"""Device that has ambient lighting."""
def get_ambientlight_entity(self):
"""Get a dictionary with info about the ambient lighting."""
return {
"device": self,
"desc": "AmbientLight",
"ambient": True,
}
class Dryer(DeviceWithDoor, DeviceWithPrograms):
"""Dryer class."""
@ -202,7 +226,7 @@ class Dryer(DeviceWithDoor, DeviceWithPrograms):
}
class Dishwasher(DeviceWithDoor, DeviceWithPrograms):
class Dishwasher(DeviceWithDoor, DeviceWithAmbientLight, DeviceWithPrograms):
"""Dishwasher class."""
PROGRAMS = [
@ -335,7 +359,7 @@ class CoffeeMaker(DeviceWithPrograms):
return {"switch": program_switches, "sensor": program_sensors}
class Hood(DeviceWithPrograms):
class Hood(DeviceWithLight, DeviceWithAmbientLight, DeviceWithPrograms):
"""Hood class."""
PROGRAMS = [
@ -346,9 +370,15 @@ class Hood(DeviceWithPrograms):
def get_entity_info(self):
"""Get a dictionary with infos about the associated entities."""
light_entity = self.get_light_entity()
ambientlight_entity = self.get_ambientlight_entity()
program_sensors = self.get_program_sensors()
program_switches = self.get_program_switches()
return {"switch": program_switches, "sensor": program_sensors}
return {
"switch": program_switches,
"sensor": program_sensors,
"light": [light_entity, ambientlight_entity],
}
class FridgeFreezer(DeviceWithDoor):