python-mystrom 2.4.0__tar.gz → 2.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: python-mystrom
3
- Version: 2.4.0
3
+ Version: 2.5.0
4
4
  Summary: Asynchronous Python API client for interacting with myStrom devices
5
5
  License: MIT
6
6
  Keywords: myStrom,API,client,asynchronous
@@ -87,9 +87,10 @@ class MyStromSwitch:
87
87
  url = URL(self.uri).join(URL("info.json"))
88
88
  response = await request(self, uri=url)
89
89
 
90
- self._firmware = response["version"]
91
- self._mac = response["mac"]
92
- self._device_type = response["type"]
90
+ # Tolerate missing keys on legacy firmware (e.g., v1 devices)
91
+ self._firmware = response.get("version")
92
+ self._mac = response.get("mac")
93
+ self._device_type = response.get("type")
93
94
 
94
95
  @property
95
96
  def device_type(self) -> Optional[str]:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-mystrom"
3
- version = "2.4.0"
3
+ version = "2.5.0"
4
4
  description = "Asynchronous Python API client for interacting with myStrom devices"
5
5
  authors = ["Fabian Affolter <fabian@affolter-engineering.ch>"]
6
6
  license = "MIT"
File without changes