lifx-emulator-core 3.0.2__tar.gz → 3.1.0__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.
Files changed (73) hide show
  1. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/CHANGELOG.md +16 -0
  2. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/PKG-INFO +3 -2
  3. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/pyproject.toml +4 -3
  4. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/server.py +4 -0
  5. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_server.py +26 -0
  6. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/.gitignore +0 -0
  7. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/README.md +0 -0
  8. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/__init__.py +0 -0
  9. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/constants.py +0 -0
  10. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/__init__.py +0 -0
  11. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/device.py +0 -0
  12. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/manager.py +0 -0
  13. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/observers.py +0 -0
  14. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/persistence.py +0 -0
  15. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/state_restorer.py +0 -0
  16. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/state_serializer.py +0 -0
  17. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/devices/states.py +0 -0
  18. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/factories/__init__.py +0 -0
  19. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/factories/builder.py +0 -0
  20. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/factories/default_config.py +0 -0
  21. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/factories/factory.py +0 -0
  22. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/factories/firmware_config.py +0 -0
  23. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/factories/serial_generator.py +0 -0
  24. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/handlers/__init__.py +0 -0
  25. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/handlers/base.py +0 -0
  26. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/handlers/device_handlers.py +0 -0
  27. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/handlers/light_handlers.py +0 -0
  28. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/handlers/multizone_handlers.py +0 -0
  29. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/handlers/registry.py +0 -0
  30. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/handlers/tile_handlers.py +0 -0
  31. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/products/__init__.py +0 -0
  32. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/products/generator.py +0 -0
  33. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/products/registry.py +0 -0
  34. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/products/specs.py +0 -0
  35. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/products/specs.yml +0 -0
  36. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/__init__.py +0 -0
  37. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/base.py +0 -0
  38. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/const.py +0 -0
  39. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/generator.py +0 -0
  40. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/header.py +0 -0
  41. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/packets.py +0 -0
  42. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/protocol_types.py +0 -0
  43. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/protocol/serializer.py +0 -0
  44. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/repositories/__init__.py +0 -0
  45. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/repositories/device_repository.py +0 -0
  46. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/repositories/storage_backend.py +0 -0
  47. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/scenarios/__init__.py +0 -0
  48. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/scenarios/manager.py +0 -0
  49. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/scenarios/models.py +0 -0
  50. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/src/lifx_emulator/scenarios/persistence.py +0 -0
  51. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/conftest.py +0 -0
  52. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_async_storage.py +0 -0
  53. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_backwards_compatibility.py +0 -0
  54. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_device.py +0 -0
  55. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_device_edge_cases.py +0 -0
  56. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_device_handlers_extended.py +0 -0
  57. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_device_manager.py +0 -0
  58. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_handler_registry.py +0 -0
  59. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_integration.py +0 -0
  60. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_light_handlers_extended.py +0 -0
  61. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_multizone_handlers_extended.py +0 -0
  62. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_observers.py +0 -0
  63. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_products_generator.py +0 -0
  64. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_products_specs.py +0 -0
  65. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_protocol_generator.py +0 -0
  66. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_protocol_types_coverage.py +0 -0
  67. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_repositories.py +0 -0
  68. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_scenario_manager.py +0 -0
  69. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_scenario_persistence.py +0 -0
  70. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_serializer.py +0 -0
  71. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_state_restorer.py +0 -0
  72. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_switch_devices.py +0 -0
  73. {lifx_emulator_core-3.0.2 → lifx_emulator_core-3.1.0}/tests/test_tile_handlers_extended.py +0 -0
@@ -2,6 +2,22 @@
2
2
 
3
3
  <!-- version list -->
4
4
 
5
+ ## v3.1.0 (2026-01-11)
6
+
7
+ ### Features
8
+
9
+ - Add Python 3.10 support
10
+ ([`c19eee5`](https://github.com/Djelibeybi/lifx-emulator/commit/c19eee5181fc3e0e3b4ef9fc3e6d47308dce7a0f))
11
+
12
+
13
+ ## v3.0.3 (2025-11-27)
14
+
15
+ ### Bug Fixes
16
+
17
+ - **core**: Update device port to match server port when adding devices
18
+ ([`db68eef`](https://github.com/Djelibeybi/lifx-emulator/commit/db68eefa764d8c98054ada19eabd6e06440f886b))
19
+
20
+
5
21
  ## v3.0.2 (2025-11-27)
6
22
 
7
23
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lifx-emulator-core
3
- Version: 3.0.2
3
+ Version: 3.1.0
4
4
  Summary: Core LIFX Emulator library for testing LIFX LAN protocol libraries
5
5
  Author-email: Avi Miller <me@dje.li>
6
6
  Maintainer-email: Avi Miller <me@dje.li>
@@ -10,6 +10,7 @@ Classifier: Framework :: Pytest
10
10
  Classifier: Intended Audience :: Developers
11
11
  Classifier: Natural Language :: English
12
12
  Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3.10
13
14
  Classifier: Programming Language :: Python :: 3.11
14
15
  Classifier: Programming Language :: Python :: 3.12
15
16
  Classifier: Programming Language :: Python :: 3.13
@@ -18,7 +19,7 @@ Classifier: Topic :: Software Development :: Libraries
18
19
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
20
  Classifier: Topic :: Software Development :: Testing
20
21
  Classifier: Typing :: Typed
21
- Requires-Python: >=3.11
22
+ Requires-Python: >=3.10
22
23
  Requires-Dist: pydantic>=2.0.0
23
24
  Requires-Dist: pyyaml>=6.0.3
24
25
  Description-Content-Type: text/markdown
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "lifx-emulator-core"
3
- version = "3.0.2"
3
+ version = "3.1.0"
4
4
  description = "Core LIFX Emulator library for testing LIFX LAN protocol libraries"
5
5
  readme = "README.md"
6
- requires-python = ">=3.11"
6
+ requires-python = ">=3.10"
7
7
  dependencies = [
8
8
  "pydantic>=2.0.0",
9
9
  "pyyaml>=6.0.3",
@@ -22,6 +22,7 @@ classifiers = [
22
22
  "Intended Audience :: Developers",
23
23
  "Natural Language :: English",
24
24
  "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3.10",
25
26
  "Programming Language :: Python :: 3.11",
26
27
  "Programming Language :: Python :: 3.12",
27
28
  "Programming Language :: Python :: 3.13",
@@ -41,7 +42,7 @@ packages = ["src/lifx_emulator"]
41
42
 
42
43
  [tool.pyright]
43
44
  typeCheckingMode = "standard"
44
- pythonVersion = "3.11"
45
+ pythonVersion = "3.10"
45
46
  include = ["src"]
46
47
  exclude = ["**/__pycache__"]
47
48
 
@@ -128,6 +128,8 @@ class EmulatedLifxServer:
128
128
 
129
129
  # Add initial devices to the device manager
130
130
  for device in devices:
131
+ # Update device port to match server port
132
+ device.state.port = self.port
131
133
  self._device_manager.add_device(device, self.scenario_manager)
132
134
 
133
135
  # Activity observer - defaults to ActivityLogger if track_activity=True
@@ -360,6 +362,8 @@ class EmulatedLifxServer:
360
362
  Returns:
361
363
  True if added, False if device with same serial already exists
362
364
  """
365
+ # Update device port to match server port
366
+ device.state.port = self.port
363
367
  return self._device_manager.add_device(device, self.scenario_manager)
364
368
 
365
369
  def remove_device(self, serial: str) -> bool:
@@ -49,6 +49,32 @@ class TestServerInitialization:
49
49
  serial = color_device.state.serial
50
50
  assert server.get_device(serial) == color_device
51
51
 
52
+ def test_server_init_updates_device_port(self, color_device):
53
+ """Test that device port is updated to match server port at init."""
54
+ # Device defaults to port 56700, but server is on custom port
55
+ custom_port = 12345
56
+ device_manager = DeviceManager(DeviceRepository())
57
+ server = EmulatedLifxServer(
58
+ [color_device], device_manager, "127.0.0.1", custom_port
59
+ )
60
+ # Device port should be updated to match server port
61
+ assert color_device.state.port == custom_port
62
+ assert server.get_device(color_device.state.serial).state.port == custom_port
63
+
64
+ def test_server_add_device_updates_port(self, color_device, multizone_device):
65
+ """Test that device port is updated when added via add_device()."""
66
+ custom_port = 54321
67
+ device_manager = DeviceManager(DeviceRepository())
68
+ server = EmulatedLifxServer(
69
+ [color_device], device_manager, "127.0.0.1", custom_port
70
+ )
71
+ # multizone_device starts with default port
72
+ assert multizone_device.state.port == 56700
73
+ # Add device to server
74
+ server.add_device(multizone_device)
75
+ # Port should be updated to match server port
76
+ assert multizone_device.state.port == custom_port
77
+
52
78
 
53
79
  class TestPacketRouting:
54
80
  """Test server packet routing logic."""