Skip to content
This repository was archived by the owner on Mar 29, 2025. It is now read-only.
Open
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

## Supported Devices

* Granary Feeder (PLAF103)
* Granary Smart Feeder (PLAF103)
* Granary Camera Feeder

## Installation

Expand All @@ -31,4 +32,4 @@ Get the folder `custom_components/petlibro` in your HA `config/custom_components
- Enter your credentials.
> Only one device can be login at the same time
>
> If you to wan to keep your phone connected, create another account for this integration and share your device to it
> If you to want to keep your phone connected, create another account for this integration and share your device to it
4 changes: 2 additions & 2 deletions custom_components/petlibro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from custom_components.petlibro.devices.feeders.feeder import Feeder

from .devices import Device
from .devices.feeders.granary_feeder import GranaryFeeder
from .devices.feeders.granary_smart_feeder import GranarySmartFeeder
from .const import DOMAIN
from .hub import PetLibroHub

Expand All @@ -17,7 +17,7 @@
Feeder: (
Platform.SWITCH,
),
GranaryFeeder: (
GranarySmartFeeder: (
Platform.SENSOR,
),
}
Expand Down
4 changes: 2 additions & 2 deletions custom_components/petlibro/devices/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Dict, Type
from .device import Device
from .feeders.granary_feeder import GranaryFeeder
from .feeders.granary_smart_feeder import GranarySmartFeeder
from .feeders.granary_camera_feeder import GranaryCameraFeeder

product_name_map : Dict[str, Type[Device]] = {
"Granary Feeder": GranaryFeeder,
"Granary Smart Feeder": GranarySmartFeeder,
"Granary Camera Feeder": GranaryCameraFeeder
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .granary_feeder import GranaryFeeder
from .granary_smart_feeder import GranarySmartFeeder

class GranaryCameraFeeder(GranaryFeeder):
class GranaryCameraFeeder(GranarySmartFeeder):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .feeder import Feeder


class GranaryFeeder(Feeder):
class GranarySmartFeeder(Feeder):
async def refresh(self):
await super().refresh()
self.update_data({
Expand Down
10 changes: 5 additions & 5 deletions custom_components/petlibro/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from .devices import Device
from .devices.feeders.feeder import Feeder
from .devices.feeders.granary_feeder import GranaryFeeder
from .devices.feeders.granary_smart_feeder import GranarySmartFeeder
from . import PetLibroHubConfigEntry
from .entity import PetLibroEntity, _DeviceT, PetLibroEntityDescription

Expand Down Expand Up @@ -95,21 +95,21 @@ def device_class(self) -> SensorDeviceClass | None:


DEVICE_SENSOR_MAP: dict[type[Device], list[PetLibroSensorEntityDescription]] = {
GranaryFeeder: [
PetLibroSensorEntityDescription[GranaryFeeder](
GranarySmartFeeder: [
PetLibroSensorEntityDescription[GranarySmartFeeder](
key="remaining_desiccant",
translation_key="remaining_desiccant",
icon="mdi:package"
),
PetLibroSensorEntityDescription[GranaryFeeder](
PetLibroSensorEntityDescription[GranarySmartFeeder](
key="today_feeding_quantity",
translation_key="today_feeding_quantity",
icon="mdi:scale",
native_unit_of_measurement_fn=unit_of_measurement_feeder,
device_class_fn=device_class_feeder,
state_class=SensorStateClass.TOTAL_INCREASING
),
PetLibroSensorEntityDescription[GranaryFeeder](
PetLibroSensorEntityDescription[GranarySmartFeeder](
key="today_feeding_times",
translation_key="today_feeding_times",
icon="mdi:history",
Expand Down