Skip to content

Commit

Permalink
Minor fix on factory class
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 committed May 22, 2021
1 parent 9523dfd commit 1f6aa34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions custom_components/smartthinq_sensors/wideq/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,7 @@ def _get_control(self, key):
return value

def init_device_info(self):
if self._device_info.platform_type == PlatformType.UNKNOWN:
return False
"""Initialize the information for the device"""

if self._model_info is None:
if self._model_data is None:
Expand Down
11 changes: 10 additions & 1 deletion custom_components/smartthinq_sensors/wideq/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@
from .styler import StylerDevice
from .washer import WasherDevice

from .device import UNIT_TEMP_CELSIUS, DeviceInfo, DeviceType, NetworkType
from .device import(
UNIT_TEMP_CELSIUS,
DeviceInfo,
DeviceType,
NetworkType,
PlatformType,
)


def get_lge_device(client, device: DeviceInfo, temp_unit=UNIT_TEMP_CELSIUS):
"""Return a device based on the device type."""

device_type = device.type
platform_type = device.platform_type
network_type = device.network_type

if platform_type == PlatformType.UNKNOWN:
return None
if network_type != NetworkType.WIFI:
return None

Expand Down

0 comments on commit 1f6aa34

Please sign in to comment.