juham-visualcrossing 0.1.7__py3-none-any.whl → 0.1.9__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.
@@ -2,7 +2,7 @@ from datetime import datetime, timedelta, timezone
2
2
  import json
3
3
  from typing_extensions import override
4
4
  from typing import Any, Optional, cast
5
- from masterpiece.mqtt import MqttMsg, Mqtt
5
+ from masterpiece import MqttMsg, Mqtt
6
6
  from juham_core import JuhamThread, JuhamCloudThread
7
7
 
8
8
 
@@ -68,7 +68,7 @@ class VisualCrossingThread(JuhamCloudThread):
68
68
  def process_data(self, data: Any) -> None:
69
69
  self.info("VisualCrossing process_data()")
70
70
  data = data.json()
71
- forecast = []
71
+ forecast: list[dict[str, Any]] = []
72
72
  self.info(f"VisualCrossing {data}")
73
73
  for day in data["days"]:
74
74
  for hour in day["hours"]:
@@ -113,6 +113,8 @@ class VisualCrossing(JuhamThread):
113
113
  update_interval.
114
114
  """
115
115
 
116
+ _VISUALCROSSING: str = "visualcrossing"
117
+
116
118
  workerThreadId: str = VisualCrossingThread.get_class_id()
117
119
  base_url: str = (
118
120
  "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/"
@@ -121,7 +123,7 @@ class VisualCrossing(JuhamThread):
121
123
  api_key: str = "SE9W7EHP775N7NDNW8ANM2MZN"
122
124
  location: str = "lahti,finland"
123
125
 
124
- def __init__(self, name="visualcrossing") -> None:
126
+ def __init__(self, name: str = "visualcrossing") -> None:
125
127
  """Constructs VisualCrossing automation object for acquiring and publishing
126
128
  forecast data.
127
129
 
@@ -148,11 +150,11 @@ class VisualCrossing(JuhamThread):
148
150
  else:
149
151
  super().on_message(client, userdata, msg)
150
152
 
151
- def on_forecast(self, em: dict) -> None:
153
+ def on_forecast(self, em: dict[str, Any]) -> None:
152
154
  """Handle weather forecast data.
153
155
 
154
156
  Args:
155
- em (dict): forecast
157
+ em (dict[str, Any]): forecast
156
158
  """
157
159
  # self.debug(f"VisualCrossing: got mqtt message {em}")
158
160
 
@@ -176,19 +178,20 @@ class VisualCrossing(JuhamThread):
176
178
  super().run()
177
179
 
178
180
  @override
179
- def to_dict(self) -> dict:
180
- data = super().to_dict()
181
- data["_visualcrossing"] = {
182
- "topic": self.forecast_topic,
183
- "url": self.base_url,
181
+ def to_dict(self) -> dict[str, Any]:
182
+ data: dict[str, dict[str, Any]] = super().to_dict()
183
+ data[self._VISUALCROSSING] = {
184
+ "forecast_topic": self.forecast_topic,
185
+ "base_url": self.base_url,
184
186
  "api_key": self.api_key,
185
- "interval": self.update_interval,
187
+ "update_interval": self.update_interval,
188
+ "location": self.location,
186
189
  }
187
190
  return data
188
191
 
189
192
  @override
190
- def from_dict(self, data) -> None:
193
+ def from_dict(self, data: dict[str, Any]) -> None:
191
194
  super().from_dict(data)
192
- if "_visualcrossing" in data:
193
- for key, value in data["_visualcrossing"].items():
195
+ if self._VISUALCROSSING in data:
196
+ for key, value in data[self._VISUALCROSSING].items():
194
197
  setattr(self, key, value)
@@ -1,4 +1,3 @@
1
- from ast import Str
2
1
  from typing_extensions import override
3
2
  from masterpiece import Plugin, Composite
4
3
  from .visualcrossing import VisualCrossing
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.4
2
+ Name: juham-visualcrossing
3
+ Version: 0.1.9
4
+ Summary: A Weather forecast plugin extending `Juham` applications
5
+ Author-email: J Meskanen <juham.api@gmail.com>
6
+ Maintainer-email: "J. Meskanen" <juham.api@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://gitlab.com/juham/juham/juham-visualcrossing
9
+ Project-URL: Bug Reports, https://gitlab.com/juham/juham/juham-visualcrossing
10
+ Project-URL: Funding, https://meskanen.com
11
+ Project-URL: Say Thanks!, http://meskanen.com
12
+ Project-URL: Source, https://gitlab.com/juham/juham/juham-visualcrossing
13
+ Keywords: object-oriented,plugin,framework
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Software Development
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/x-rst
20
+ License-File: LICENSE.rst
21
+ Requires-Dist: juham-core>=0.1.5
22
+ Requires-Dist: pytz>=2024.1
23
+ Provides-Extra: dev
24
+ Requires-Dist: check-manifest; extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ VisualCrossing forecast plugin for Juham™
28
+ =========================================
29
+
30
+ Description
31
+ -----------
32
+
33
+ Adds forecast support to Juham™ home automation.
34
+
35
+ .. image:: _static/images/visualcrossing.png
36
+ :alt: Solar and temperature forecasts
37
+ :width: 640px
38
+ :align: center
39
+
40
+
41
+ Project Status
42
+ --------------
43
+
44
+ **Current State**: **Alpha (Status 3)**
45
+
46
+ Please check out the `CHANGELOG <CHANGELOG.rst>`_ file for changes in this release.
47
+
48
+
49
+
50
+ Getting Started
51
+ ---------------
52
+
53
+ ### Installation
54
+
55
+ 1. Install
56
+
57
+ .. code-block:: bash
58
+
59
+ pip install juham_visualcrossing
60
+
61
+
62
+ 2. Configure
63
+
64
+ - ``VisualCrossing.json``: Add your Visual Crossing API key for weather forecasts.
65
+
@@ -0,0 +1,10 @@
1
+ juham_visualcrossing/__init__.py,sha256=7Xv5LN6-LEd9cpYZBrQqQshEScEkoMyWrTcZE9IkE8o,282
2
+ juham_visualcrossing/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
+ juham_visualcrossing/visualcrossing.py,sha256=6plkxOS0jTwuBk-Lg9zaw_mETAhyYUeOMlPl8cOyncY,7228
4
+ juham_visualcrossing/visualcrossing_plugin.py,sha256=nhm05gczzpkc_KEja-Mk1U5cgnwClHEIgVEw1P_sGFc,605
5
+ juham_visualcrossing-0.1.9.dist-info/licenses/LICENSE.rst,sha256=xCUTZIYDotncT_ibKn8nNVkUGiK05hJyOWypG8G7Evk,1074
6
+ juham_visualcrossing-0.1.9.dist-info/METADATA,sha256=AB2tMjyFYEhsi4pU3wqYNccnW1ziMZ5Hoy2VPgfQ07E,1710
7
+ juham_visualcrossing-0.1.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ juham_visualcrossing-0.1.9.dist-info/entry_points.txt,sha256=BMRgZy0x03nSQfh37apI68H1nlgU0bGsvkV6LrnF1eI,82
9
+ juham_visualcrossing-0.1.9.dist-info/top_level.txt,sha256=7yWaUHZo-Ng96VJBzUFhaFCBamL71PUjIxZISxMBjSM,21
10
+ juham_visualcrossing-0.1.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: juham-visualcrossing
3
- Version: 0.1.7
4
- Summary: A Weather forecast plugin extending `Juham` applications
5
- Author-email: J Meskanen <juham.api@gmail.com>
6
- Maintainer-email: "J. Meskanen" <juham.api@gmail.com>
7
- Project-URL: Homepage, https://meskanen.com
8
- Project-URL: Bug Reports, https://meskanen.com
9
- Project-URL: Funding, https://meskanen.com
10
- Project-URL: Say Thanks!, http://meskanen.com
11
- Project-URL: Source, https://meskanen.com
12
- Keywords: object-oriented,plugin,framework
13
- Classifier: Development Status :: 3 - Alpha
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Topic :: Software Development
16
- Classifier: License :: OSI Approved :: MIT License
17
- Classifier: Programming Language :: Python :: 3.8
18
- Requires-Python: >=3.8
19
- Description-Content-Type: text/x-rst
20
- License-File: LICENSE.rst
21
- Requires-Dist: juham-automation>=0.0.7
22
- Requires-Dist: pytz>=2024.1
23
- Provides-Extra: dev
24
- Requires-Dist: check-manifest; extra == "dev"
@@ -1,10 +0,0 @@
1
- juham_visualcrossing/__init__.py,sha256=7Xv5LN6-LEd9cpYZBrQqQshEScEkoMyWrTcZE9IkE8o,282
2
- juham_visualcrossing/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
- juham_visualcrossing/visualcrossing.py,sha256=N0z3UZAlelHXXg0z9OFMvkWQO6pgZBGPmS7AU_ZTxrc,7017
4
- juham_visualcrossing/visualcrossing_plugin.py,sha256=Qj9On-gcobpErjBJ4jEvSnAAaQor7sbPCUFq-XxIalA,625
5
- juham_visualcrossing-0.1.7.dist-info/LICENSE.rst,sha256=xCUTZIYDotncT_ibKn8nNVkUGiK05hJyOWypG8G7Evk,1074
6
- juham_visualcrossing-0.1.7.dist-info/METADATA,sha256=KkKLoCM8Qoa2TbKE011uOmrr_ixFXKgOaej3hpMo10c,947
7
- juham_visualcrossing-0.1.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
8
- juham_visualcrossing-0.1.7.dist-info/entry_points.txt,sha256=BMRgZy0x03nSQfh37apI68H1nlgU0bGsvkV6LrnF1eI,82
9
- juham_visualcrossing-0.1.7.dist-info/top_level.txt,sha256=7yWaUHZo-Ng96VJBzUFhaFCBamL71PUjIxZISxMBjSM,21
10
- juham_visualcrossing-0.1.7.dist-info/RECORD,,