1818from letpot .exceptions import (
1919 LetPotAuthenticationException ,
2020 LetPotConnectionException ,
21- LetPotDeviceTypeException ,
21+ LetPotDeviceCategoryException ,
2222 LetPotException ,
2323 LetPotFeatureException ,
2424)
@@ -410,7 +410,7 @@ async def set_light_brightness(self, serial: str, level: int) -> None:
410410
411411 use_status = self ._get_publish_status (serial )
412412 if not isinstance (use_status , LetPotGardenStatus ):
413- raise LetPotDeviceTypeException ()
413+ raise LetPotDeviceCategoryException ()
414414 status = dataclasses .replace (use_status , light_brightness = level )
415415 await self ._publish_status (serial , status )
416416
@@ -419,7 +419,7 @@ async def set_light_mode(self, serial: str, mode: LightMode) -> None:
419419 """Set the light mode for this device (flower/vegetable)."""
420420 use_status = self ._get_publish_status (serial )
421421 if not isinstance (use_status , LetPotGardenStatus ):
422- raise LetPotDeviceTypeException ()
422+ raise LetPotDeviceCategoryException ()
423423 status = dataclasses .replace (use_status , light_mode = mode )
424424 await self ._publish_status (serial , status )
425425
@@ -430,7 +430,7 @@ async def set_light_schedule(
430430 """Set the light schedule for this device (start time and/or end time)."""
431431 use_status = self ._get_publish_status (serial )
432432 if not isinstance (use_status , LetPotGardenStatus ):
433- raise LetPotDeviceTypeException ()
433+ raise LetPotDeviceCategoryException ()
434434 start_time = use_status .light_schedule_start if start is None else start
435435 end_time = use_status .light_schedule_end if end is None else end
436436 status = dataclasses .replace (
@@ -445,7 +445,7 @@ async def set_plant_days(self, serial: str, days: int) -> None:
445445 """Set the plant days counter for this device (number of days)."""
446446 use_status = self ._get_publish_status (serial )
447447 if not isinstance (use_status , LetPotGardenStatus ):
448- raise LetPotDeviceTypeException ()
448+ raise LetPotDeviceCategoryException ()
449449 status = dataclasses .replace (use_status , plant_days = days )
450450 await self ._publish_status (serial , status )
451451
@@ -454,7 +454,7 @@ async def set_power(self, serial: str, on: bool) -> None:
454454 """Set the general power for this device (on/off)."""
455455 use_status = self ._get_publish_status (serial )
456456 if not isinstance (use_status , LetPotGardenStatus ):
457- raise LetPotDeviceTypeException ()
457+ raise LetPotDeviceCategoryException ()
458458 status = dataclasses .replace (use_status , system_on = on )
459459 await self ._publish_status (serial , status )
460460
@@ -470,7 +470,7 @@ async def set_sound(self, serial: str, on: bool) -> None:
470470 """Set the alarm sound for this device (on/off)."""
471471 use_status = self ._get_publish_status (serial )
472472 if not isinstance (use_status , LetPotGardenStatus ):
473- raise LetPotDeviceTypeException ()
473+ raise LetPotDeviceCategoryException ()
474474 status = dataclasses .replace (use_status , system_sound = on )
475475 await self ._publish_status (serial , status )
476476
@@ -479,7 +479,7 @@ async def set_temperature_unit(self, serial: str, unit: TemperatureUnit) -> None
479479 """Set the temperature unit for this device (Celsius/Fahrenheit)."""
480480 use_status = self ._get_publish_status (serial )
481481 if not isinstance (use_status , LetPotGardenStatus ):
482- raise LetPotDeviceTypeException ()
482+ raise LetPotDeviceCategoryException ()
483483 status = dataclasses .replace (use_status , temperature_unit = unit )
484484 await self ._publish_status (serial , status )
485485
@@ -488,7 +488,7 @@ async def set_water_mode(self, serial: str, on: bool) -> None:
488488 """Set the automatic water/nutrient mode for this device (on/off)."""
489489 use_status = self ._get_publish_status (serial )
490490 if not isinstance (use_status , LetPotGardenStatus ):
491- raise LetPotDeviceTypeException ()
491+ raise LetPotDeviceCategoryException ()
492492 status = dataclasses .replace (use_status , water_mode = 1 if on else 0 )
493493 await self ._publish_status (serial , status )
494494
0 commit comments