HueBLE 2.2.1__tar.gz → 2.2.3__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.4
2
2
  Name: HueBLE
3
- Version: 2.2.1
3
+ Version: 2.2.3
4
4
  Summary: Python module for controlling and monitoring Bluetooth Philips Hue bulbs
5
5
  Author-email: Harvey Lelliott <harveylelliott@duck.com>
6
6
  License: MIT License
@@ -44,7 +44,7 @@ Description-Content-Type: text/markdown
44
44
  License-File: LICENSE.txt
45
45
  Requires-Dist: bleak>=0.19.0
46
46
  Requires-Dist: bleak-retry-connector
47
- Requires-Dist: dbus-fast
47
+ Requires-Dist: dbus-fast; sys_platform == "linux"
48
48
  Dynamic: license-file
49
49
 
50
50
  # HueBLE
@@ -1,3 +1,5 @@
1
1
  bleak>=0.19.0
2
2
  bleak-retry-connector
3
+
4
+ [:sys_platform == "linux"]
3
5
  dbus-fast
@@ -16,10 +16,6 @@ from bleak_retry_connector import establish_connection
16
16
  from struct import pack, unpack
17
17
  from typing import Callable
18
18
  from enum import Enum
19
- from dbus_fast.aio import MessageBus
20
- from dbus_fast.service import ServiceInterface, method
21
- from dbus_fast import BusType
22
-
23
19
 
24
20
  #: String containing manufacturer. Handle 15.
25
21
  UUID_MANUFACTURER = "00002a29-0000-1000-8000-00805f9b34fb"
@@ -151,6 +147,13 @@ class EffectType(Enum):
151
147
  SUNBEAM = 0x10
152
148
  ENCHANT = 0x11
153
149
 
150
+ @classmethod
151
+ def _missing_(cls, value):
152
+ _LOGGER.warning(
153
+ f"Unknown effect type: '{value}' reported by light, using default of none!"
154
+ )
155
+ return cls.NONE
156
+
154
157
 
155
158
  #: EFFECT_COMMANDS (hex string) for the Effect Characteristic endpoint containing one byte id and one byte data length
156
159
  class EffectCommands(Enum):
@@ -684,6 +687,9 @@ class HueBleLight(object):
684
687
 
685
688
  async def _pair_bluez(self):
686
689
  """Workaround for bluez authentication issues."""
690
+ from dbus_fast.aio import MessageBus
691
+ from dbus_fast.service import ServiceInterface, method
692
+ from dbus_fast import BusType
687
693
 
688
694
  class BluezAgent(ServiceInterface):
689
695
  """Agent for automatically accepting pairing passkeys."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: HueBLE
3
- Version: 2.2.1
3
+ Version: 2.2.3
4
4
  Summary: Python module for controlling and monitoring Bluetooth Philips Hue bulbs
5
5
  Author-email: Harvey Lelliott <harveylelliott@duck.com>
6
6
  License: MIT License
@@ -44,7 +44,7 @@ Description-Content-Type: text/markdown
44
44
  License-File: LICENSE.txt
45
45
  Requires-Dist: bleak>=0.19.0
46
46
  Requires-Dist: bleak-retry-connector
47
- Requires-Dist: dbus-fast
47
+ Requires-Dist: dbus-fast; sys_platform == "linux"
48
48
  Dynamic: license-file
49
49
 
50
50
  # HueBLE
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "HueBLE"
3
- version = "2.2.1"
3
+ version = "2.2.3"
4
4
  dependencies = [
5
5
  "bleak>=0.19.0",
6
6
  "bleak-retry-connector",
7
- "dbus-fast"
7
+ "dbus-fast; sys_platform == 'linux'"
8
8
  ]
9
9
  requires-python = ">= 3.11"
10
10
  authors = [
@@ -370,6 +370,29 @@ async def test_commands(
370
370
  },
371
371
  id="temperature_effect",
372
372
  ),
373
+ pytest.param(
374
+ {
375
+ HueBLE.UUID_MANUFACTURER: "Philippe Hue".encode(),
376
+ HueBLE.UUID_MODEL: "Fancy new light".encode(),
377
+ HueBLE.UUID_FW_VERSION: "1.7.10".encode(),
378
+ HueBLE.UUID_ZIGBEE_ADDRESS: bytes.fromhex("00010203040506070809"),
379
+ HueBLE.UUID_NAME: "L A M P".encode(),
380
+ HueBLE.UUID_EFFECTS: bytes.fromhex("01010102014503022c01060115080138"),
381
+ },
382
+ {
383
+ "manufacturer": "Philippe Hue",
384
+ "model": "Fancy new light",
385
+ "firmware": "1.7.10",
386
+ "zigbee_address": "00:01:02:03:04:05:06:07:08:09",
387
+ "name_in_app": "L A M P",
388
+ "power_state": True,
389
+ "brightness": 69,
390
+ "colour_temp": 300,
391
+ "colour_xy": None,
392
+ "effect": (HueBLE.EffectType.NONE, 56),
393
+ },
394
+ id="unknown_effect",
395
+ ),
373
396
  ],
374
397
  )
375
398
  async def test_poll_state(
File without changes
File without changes
File without changes