pypetkitapi 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pypetkitapi/client.py CHANGED
@@ -101,6 +101,7 @@ class PetKitClient:
101
101
  await self._get_api_server_list()
102
102
  _LOGGER.debug("Finding region server for region: %s", self.region)
103
103
 
104
+ # TODO : Improve this
104
105
  if self.region == "china":
105
106
  self._base_url = PetkitURL.CHINA_SRV
106
107
  return
@@ -117,7 +118,7 @@ class PetKitClient:
117
118
 
118
119
  if regional_server:
119
120
  _LOGGER.debug(
120
- "Found server %s for region : %s", regional_server, self.region
121
+ "Using server %s for region : %s", regional_server, self.region
121
122
  )
122
123
  self._base_url = regional_server.gateway
123
124
  return
pypetkitapi/command.py CHANGED
@@ -160,10 +160,10 @@ class CmdData:
160
160
  def get_endpoint_manual_feed(device):
161
161
  """Get the endpoint for the device"""
162
162
  if device.device_type == FEEDER_MINI:
163
- return PetkitEndpoint.MINI_MANUAL_FEED
163
+ return PetkitEndpoint.MANUAL_FEED_MINI
164
164
  if device.device_type == FEEDER:
165
- return PetkitEndpoint.FRESH_ELEMENT_MANUAL_FEED
166
- return PetkitEndpoint.MANUAL_FEED
165
+ return PetkitEndpoint.MANUAL_FEED_FRESH_ELEMENT
166
+ return PetkitEndpoint.MANUAL_FEED_DUAL
167
167
 
168
168
 
169
169
  def get_endpoint_reset_desiccant(device):
@@ -195,7 +195,7 @@ ACTIONS_MAP = {
195
195
  supported_device=DEVICES_FEEDER, # TODO: Check if this is correct
196
196
  ),
197
197
  FeederCommand.MANUAL_FEED_DUAL: CmdData(
198
- endpoint=PetkitEndpoint.UPDATE_SETTING,
198
+ endpoint=PetkitEndpoint.MANUAL_FEED_DUAL,
199
199
  params=lambda device, setting: {
200
200
  "day": datetime.datetime.now().strftime("%Y%m%d"),
201
201
  "deviceId": device.id,
@@ -203,7 +203,7 @@ ACTIONS_MAP = {
203
203
  "time": "-1",
204
204
  **setting,
205
205
  },
206
- supported_device=ALL_DEVICES,
206
+ supported_device=[D4S, D4SH],
207
207
  ),
208
208
  FeederCommand.CANCEL_MANUAL_FEED: CmdData(
209
209
  endpoint=lambda device: (
pypetkitapi/const.py CHANGED
@@ -108,6 +108,6 @@ class PetkitEndpoint(StrEnum):
108
108
  FRESH_ELEMENT_DESICCANT_RESET = "feeder/desiccant_reset"
109
109
  CALL_PET = "callPet"
110
110
  CANCEL_FEED = "cancelRealtimeFeed"
111
- MINI_MANUAL_FEED = "feedermini/save_dailyfeed"
112
- FRESH_ELEMENT_MANUAL_FEED = "feeder/save_dailyfeed"
113
- MANUAL_FEED = "saveDailyFeed"
111
+ MANUAL_FEED_MINI = "feedermini/save_dailyfeed"
112
+ MANUAL_FEED_FRESH_ELEMENT = "feeder/save_dailyfeed"
113
+ MANUAL_FEED_DUAL = "saveDailyFeed"
pypetkitapi/exceptions.py CHANGED
@@ -22,8 +22,8 @@ class PetkitRegionalServerNotFoundError(PypetkitError):
22
22
  """Initialize the exception."""
23
23
  self.region = region
24
24
  self.message = (
25
- f"Region you provided: '{region}' was not found in the server list. "
26
- f"Are you sure you provided the correct region?"
25
+ f"Region you provided: '{region}' was not found in the Petkit's server list. "
26
+ f"Are you sure you provided the correct region ?"
27
27
  )
28
28
  super().__init__(self.message)
29
29
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pypetkitapi
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Python client for PetKit API
5
5
  Home-page: https://github.com/Jezza34000/pypetkit
6
6
  License: MIT
@@ -0,0 +1,13 @@
1
+ pypetkitapi/__init__.py,sha256=eVpyGMD3tkYtiHUkdKEeNSZhQlZ4woI2Y5oVoV7CwXM,61
2
+ pypetkitapi/client.py,sha256=iamSdR-rYfi3MqvqlyCbO2k-z6BF407flrM_SAczVi8,14821
3
+ pypetkitapi/command.py,sha256=5SdCVRWJl1t9sMIZqQ5XVc1CAyY9B5sF2vJvwlNXj6E,9289
4
+ pypetkitapi/const.py,sha256=Abhrs1cS0a2G_7eFHoOA3somw5HCC0gEq7AoNjuEDbY,2993
5
+ pypetkitapi/containers.py,sha256=XhNbRUztnBpIr9cypDoyE3MHojic831G5GSisK9B7kU,3123
6
+ pypetkitapi/exceptions.py,sha256=NWmpsI2ewC4HaIeu_uFwCeuPIHIJxZBzjoCP7aNwvhs,1139
7
+ pypetkitapi/feeder_container.py,sha256=IGXeAEbLkZhOTCzF2MhwqadIAKXg6jHbfU037dt6byY,10985
8
+ pypetkitapi/litter_container.py,sha256=aLAvcB8K_nx7iBRkAarZs-48HAj2NkG7XjJFonWMuME,8948
9
+ pypetkitapi/water_fountain_container.py,sha256=LcCTDjk7eSbnF7e38xev3D5mCv5wwJ6go8WGGBv-CaU,5278
10
+ pypetkitapi-0.4.0.dist-info/LICENSE,sha256=4FWnKolNLc1e3w6cVlT61YxfPh0DQNeQLN1CepKKSBg,1067
11
+ pypetkitapi-0.4.0.dist-info/METADATA,sha256=eKhZ3gI8UghjrUZZpz2NsBhQTqwKi1SMvjVI31G1cYs,3611
12
+ pypetkitapi-0.4.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
13
+ pypetkitapi-0.4.0.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- pypetkitapi/__init__.py,sha256=eVpyGMD3tkYtiHUkdKEeNSZhQlZ4woI2Y5oVoV7CwXM,61
2
- pypetkitapi/client.py,sha256=yb7RWlr_F1yrmmYRvQNKEt2Zd6PClsctRZYa0nRVtH0,14791
3
- pypetkitapi/command.py,sha256=ibJ0zenONy-FBvUvyIA_IvUnYEUezLpPxhC_9XZ6SwM,9282
4
- pypetkitapi/const.py,sha256=XKiybtizB115OwVo7l9d2bZyVfkFjYWEtt9mBwYLcDk,2988
5
- pypetkitapi/containers.py,sha256=XhNbRUztnBpIr9cypDoyE3MHojic831G5GSisK9B7kU,3123
6
- pypetkitapi/exceptions.py,sha256=f9QY1EME9ha_vJJx4DuL_OBNpoynYVdtMFtVZbdfook,1129
7
- pypetkitapi/feeder_container.py,sha256=IGXeAEbLkZhOTCzF2MhwqadIAKXg6jHbfU037dt6byY,10985
8
- pypetkitapi/litter_container.py,sha256=aLAvcB8K_nx7iBRkAarZs-48HAj2NkG7XjJFonWMuME,8948
9
- pypetkitapi/water_fountain_container.py,sha256=LcCTDjk7eSbnF7e38xev3D5mCv5wwJ6go8WGGBv-CaU,5278
10
- pypetkitapi-0.3.0.dist-info/LICENSE,sha256=4FWnKolNLc1e3w6cVlT61YxfPh0DQNeQLN1CepKKSBg,1067
11
- pypetkitapi-0.3.0.dist-info/METADATA,sha256=FaCJfahbgxUuDf8kfEeVhwn22vDPWu9bEfvmVRO43sk,3611
12
- pypetkitapi-0.3.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
13
- pypetkitapi-0.3.0.dist-info/RECORD,,