Skip to content

Commit

Permalink
Merge pull request #1 from RobertD502/dev
Browse files Browse the repository at this point in the history
- Add support for Infinity feeder and Pura X
- Add purified water today sensor for water fountain
- Fix energy usage calculation for water fountain
- Disable light brightness entity when light is turned off on water fountain
  • Loading branch information
RobertD502 authored Feb 23, 2023
2 parents 7668330 + 15210da commit aa9c51d
Show file tree
Hide file tree
Showing 9 changed files with 4,836 additions and 113 deletions.
245 changes: 197 additions & 48 deletions README.md

Large diffs are not rendered by default.

369 changes: 359 additions & 10 deletions custom_components/petkit/binary_sensor.py

Large diffs are not rendered by default.

359 changes: 351 additions & 8 deletions custom_components/petkit/button.py

Large diffs are not rendered by default.

128 changes: 128 additions & 0 deletions custom_components/petkit/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.NUMBER,
Platform.SELECT,
Platform.SENSOR,
Platform.SWITCH,
Expand Down Expand Up @@ -65,10 +66,30 @@
}

FEEDERS = {
'd3': 'Fresh Element Infinity',
'd4': 'Fresh Element Solo',
'feedermini': 'Fresh Element Mini Pro',
}

LITTER_BOXES = {
't3': 'PURA X',
't4': 'PURA MAX',
}

CLEANING_INTERVAL_NAMED = {
0: 'Disabled',
300: '5min',
600: '10min',
900: '15min',
1800: '30min',
2700: '45min',
3600: '1h',
4500: '1h15min',
5400: '1h30min',
6300: '1h45min',
7200: '2h'
}

FEEDER_MANUAL_FEED_OPTIONS = ['', '1/10th Cup (10g)', '1/5th Cup (20g)', '3/10th Cup (30g)', '2/5th Cup (40g)', '1/2 Cup (50g)']
MINI_FEEDER_MANUAL_FEED_OPTIONS = [
'',
Expand All @@ -84,6 +105,12 @@
'1/2 Cup (50g)'
]

LITTER_TYPE_NAMED = {
1: 'Bentonite',
2: 'Tofu',
3: 'Mixed'
}

MANUAL_FEED_NAMED = {
0: '',
5: '1/20th Cup (5g)',
Expand All @@ -97,3 +124,104 @@
45: '9/20th Cup (45g)',
50: '1/2 Cup (50g)'
}

VALID_EVENT_TYPES = [5, 6, 7, 8, 10]
EVENT_TYPE_NAMED = {
5: 'Cleaning Completed',
6: 'Dumping Over',
7: 'Reset Over',
8: 'Spray Over',
10: 'Pet Out',
}

# Event Type --> Result --> Reason --> Optional(Error)
EVENT_DESCRIPTION = {
5: {
0: {
0: 'Auto cleaning completed',
1: 'Periodic cleaning completed',
2: 'Manual cleaning completed',
3: 'Manual cleaning completed',
},
1: {
0: 'Automatic cleaning terminated',
1: 'Periodic cleaning terminated',
2: 'Manual cleaning terminated',
3: 'Manual cleaning terminated',
},
2: {
0: {
'full': 'Automatic cleaning failed, waste collection bin is full, please empty promptly',
'hallL': 'Automatic cleaning failure, the cylinder is not properly locked in place, please check',
'hallT': 'Automatic cleaning failure, the litter box\'s upper cupper cover is not placed properly, please check',
},
1: {
'full': 'Scheduled cleaning failed, waste collection bin is full, please empty promptly',
'hallL': 'Scheduled cleaning failure, the cylinder is not properly locked in place, please check',
'hallT': 'Scheduled cleaning failure, the litter box\'s upper cupper cover is not placed properly, please check',
},
2: {
'full': 'Manual cleaning failed, waste collection bin is full, please empty promptly',
'hallL': 'Manual cleaning failure, the cylinder is not properly locked in place, please check',
'hallT': 'Manual cleaning failure, the litter box\'s upper cupper cover is not placed properly, please check',
},
3: {
'full': 'Manual cleaning failed, waste collection bin is full, please empty promptly',
'hallL': 'Manual cleaning failure, the cylinder is not properly locked in place, please check',
'hallT': 'Manual cleaning failure, the litter box\'s upper cupper cover is not placed properly, please check',
},
},
3: {
0: 'Automatic cleaning cancelled, device in operation',
1: 'Periodic cleaning cancelled, device in operation',
2: 'Manual cleaning cancelled, device in operation',
3: 'Manual cleaning cancelled, device in operation',
},
4: {
0: 'Kitten mode is enabled, auto cleaning is canceled',
1: 'Kitten mode is enabled, periodically cleaning is canceled',
},
},
6: {
0: 'Cat litter empty completed',
1: 'Cat litter empty terminated',
2: {
'full': 'Cat litter empty failed, waste collection bin is full, please empty promptly',
'hallL': 'Cat litter empty failure, the cylinder is not properly locked in place, please check',
'hallT': 'Cat litter empty failure, the litter box\'s cupper cover is not placed properly, please check',
},
},
7: {
0: 'Device reset completed',
1: 'Device reset terminated',
2: {
'full': 'Device reset failed, waste collection bin is full, please empty promptly',
'hallL': 'Device reset failure, the cylinder is not properly locked in place, please check',
'hallT': 'Device reset failure, the litter box\'s cupper cover is not placed properly, please check',
},
},
8: {
0: {
0: 'Deodorant finished',
1: 'Periodic odor removal completed',
2: 'Manual odor removal completed',
3: 'Manual odor removal completed',
},
1: {
0: 'Deodorant finished, not enough purifying liquid, please refill in time',
1: 'Periodic odor removal completed, not enough purifying liquid, please refill in time',
2: 'Manual odor removal completed, not enough purifying liquid, please refill in time',
3: 'Manual odor removal completed, not enough purifying liquid, please refill in time',
},
2: {
0: 'Automatic odor removal failed, odor eliminator error',
1: 'Periodic odor removal failure, odor eliminator malfunction',
2: 'Manual odor removal failure, odor eliminator malfunction',
3: 'Manual odor removal failure, odor eliminator malfunction',
},
},
}




4 changes: 2 additions & 2 deletions custom_components/petkit/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"domain": "petkit",
"name": "PetKit",
"version": "0.1.0b0",
"version": "0.1.0b1",
"integration_type": "hub",
"iot_class": "cloud_polling",
"documentation": "https://github.com/RobertD502/home-assistant-petkit/blob/main/README.md",
"issue_tracker": "https://github.com/RobertD502/home-assistant-petkit/issues",
"config_flow": true,
"requirements": ["petkitaio==0.1.0"],
"requirements": ["petkitaio==0.1.1", "tzlocal>=4.2"],
"dependencies": [],
"codeowners": ["@RobertD502"]
}
Loading

0 comments on commit aa9c51d

Please sign in to comment.