zcc-helper 3.2.dev7__tar.gz → 3.2.dev9__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zcc-helper
3
- Version: 3.2.dev7
3
+ Version: 3.2.dev9
4
4
  Summary: ZIMI ZCC helper module
5
5
  Home-page: UNKNOWN
6
6
  Author: Mark Hannon
@@ -81,28 +81,28 @@ async def main(args):
81
81
 
82
82
  if device:
83
83
  if 'CloseDoor' in options.action:
84
- device.close_door()
84
+ await device.close_door()
85
85
  elif 'OpenDoor' in options.action:
86
- device.open_door()
86
+ await device.open_door()
87
87
  elif 'TurnOn' in options.action:
88
- device.turn_on()
88
+ await device.turn_on()
89
89
  elif 'TurnOff' in options.action:
90
- device.turn_off()
90
+ await device.turn_off()
91
91
  elif 'OpenToPercentage' in options.action:
92
92
  if options.value:
93
- device.open_to_percentage(options.value)
93
+ await device.open_to_percentage(options.value)
94
94
  else:
95
95
  raise ControlPointError(
96
96
  'OpenToPercentage requires --value')
97
97
  elif 'SetBrightness' in options.action:
98
98
  if options.value:
99
- device.set_brightness(options.value)
99
+ await device.set_brightness(options.value)
100
100
  else:
101
101
  raise ControlPointError(
102
102
  'SetBrightness requires --value')
103
103
  elif 'SetFanSpeed' in options.action:
104
104
  if options.value:
105
- device.set_fanspeed(options.value)
105
+ await device.set_fanspeed(options.value)
106
106
  else:
107
107
  raise ControlPointError(
108
108
  'SetFanSpeed requires --value')
@@ -9,4 +9,4 @@ APP_ID = 'ZvWqWJQB'
9
9
  APP_TOKEN = '3422ecbb-cf6a-404c-b3dc-2023dd213535'
10
10
 
11
11
  NAME = 'zcc-helper'
12
- VERSION = '3.2dev7'
12
+ VERSION = '3.2dev9'
@@ -318,13 +318,17 @@ class ControlPoint:
318
318
  ControlPointProtocol.GATEWAY_PROPERTIES, None))
319
319
  if response.get(ControlPointProtocol.ZCC_STATUS, None):
320
320
  self.logger.error("ZCC status message\n%s", pformat(response))
321
+ await self.re_connect(reset=True)
321
322
 
322
- async def re_connect(self):
323
+ async def re_connect(self, reset: bool = False):
323
324
  '''Re-connect to a new socket and resend any queued messages.'''
324
325
 
325
- self.logger.error('Existing socket closed')
326
+ if reset:
327
+ self.logger.error('Initiating new socket after existing socket reset')
328
+ else:
329
+ self.logger.error('Existing socket closed')
326
330
 
327
- self.socket.unsubscribe()
331
+ self.socket.unsubscribe(self)
328
332
  self.socket.close()
329
333
 
330
334
  self.closed_socket = self.socket
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zcc-helper
3
- Version: 3.2.dev7
3
+ Version: 3.2.dev9
4
4
  Summary: ZIMI ZCC helper module
5
5
  Home-page: UNKNOWN
6
6
  Author: Mark Hannon
File without changes
File without changes
File without changes
File without changes