juham-core 0.2.2__tar.gz → 0.2.4__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 (35) hide show
  1. {juham_core-0.2.2/juham_core.egg-info → juham_core-0.2.4}/PKG-INFO +3 -29
  2. juham_core-0.2.4/docs/source/CHANGELOG.rst +78 -0
  3. juham_core-0.2.4/docs/source/CONTRIBUTING.rst +44 -0
  4. juham_core-0.2.4/docs/source/LICENSE.rst +25 -0
  5. juham_core-0.2.4/docs/source/README.rst +38 -0
  6. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core/juham.py +12 -5
  7. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core/juham_thread.py +1 -1
  8. {juham_core-0.2.2 → juham_core-0.2.4/juham_core.egg-info}/PKG-INFO +3 -29
  9. juham_core-0.2.4/juham_core.egg-info/SOURCES.txt +32 -0
  10. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core.egg-info/requires.txt +1 -1
  11. {juham_core-0.2.2 → juham_core-0.2.4}/pyproject.toml +3 -4
  12. juham_core-0.2.4/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  13. juham_core-0.2.4/tests/__pycache__/test_juham.cpython-312-pytest-9.0.1.pyc +0 -0
  14. juham_core-0.2.4/tests/__pycache__/test_juham.cpython-312.pyc +0 -0
  15. juham_core-0.2.4/tests/__pycache__/test_juham_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  16. juham_core-0.2.4/tests/__pycache__/test_juham_ts.cpython-312.pyc +0 -0
  17. juham_core-0.2.4/tests/__pycache__/test_timeutils.cpython-312-pytest-9.0.1.pyc +0 -0
  18. juham_core-0.2.4/tests/__pycache__/test_timeutils.cpython-312.pyc +0 -0
  19. juham_core-0.2.2/juham_core.egg-info/SOURCES.txt +0 -21
  20. {juham_core-0.2.2 → juham_core-0.2.4}/LICENSE.rst +0 -0
  21. {juham_core-0.2.2 → juham_core-0.2.4}/MANIFEST.in +0 -0
  22. {juham_core-0.2.2 → juham_core-0.2.4}/README.rst +0 -0
  23. {juham_core-0.2.2 → juham_core-0.2.4}/examples/myapp.py +0 -0
  24. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core/__init__.py +0 -0
  25. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core/juham_cloud.py +0 -0
  26. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core/juham_ts.py +0 -0
  27. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core/py.typed +0 -0
  28. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core/timeutils.py +0 -0
  29. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core.egg-info/dependency_links.txt +0 -0
  30. {juham_core-0.2.2 → juham_core-0.2.4}/juham_core.egg-info/top_level.txt +0 -0
  31. {juham_core-0.2.2 → juham_core-0.2.4}/setup.cfg +0 -0
  32. {juham_core-0.2.2 → juham_core-0.2.4}/tests/__init__.py +0 -0
  33. {juham_core-0.2.2 → juham_core-0.2.4}/tests/test_juham.py +0 -0
  34. {juham_core-0.2.2 → juham_core-0.2.4}/tests/test_juham_ts.py +0 -0
  35. {juham_core-0.2.2 → juham_core-0.2.4}/tests/test_timeutils.py +0 -0
@@ -1,35 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: juham-core
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Juha's Ultimate Home Automation Core
5
5
  Author-email: J Meskanen <juham.api@gmail.com>
6
6
  Maintainer-email: "J. Meskanen" <juham.api@gmail.com>
7
- License: LICENSE
8
- =======
9
-
10
- Copyright (c) 2024, Juha Meskanen
11
-
12
- Permission is hereby granted, free of charge, to any person obtaining
13
- a copy of this software and associated documentation files (the
14
- "Software"), to deal in the Software without restriction, including
15
- without limitation the rights to use, copy, modify, merge, publish,
16
- distribute, sublicense, and/or sell copies of the Software, and to
17
- permit persons to whom the Software is furnished to do so, subject to
18
- the following conditions:
19
-
20
- **The above copyright notice and this permission notice shall be included in all
21
- copies or substantial portions of the Software.**
22
-
23
-
24
- ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
27
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
28
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
30
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **
31
-
32
-
7
+ License-Expression: MIT
33
8
  Project-URL: Homepage, https://gitlab.com/juham/juham/juham_core
34
9
  Project-URL: Bug Reports, https://gitlab.com/juham/juham/juham_core
35
10
  Project-URL: Funding, https://meskanen.com
@@ -39,12 +14,11 @@ Keywords: home,automation,juham
39
14
  Classifier: Development Status :: 4 - Beta
40
15
  Classifier: Intended Audience :: Developers
41
16
  Classifier: Topic :: Software Development
42
- Classifier: License :: Public Domain
43
17
  Classifier: Programming Language :: Python :: 3.8
44
18
  Requires-Python: >=3.8
45
19
  Description-Content-Type: text/markdown
46
20
  License-File: LICENSE.rst
47
- Requires-Dist: masterpiece>=0.1.48
21
+ Requires-Dist: masterpiece>=0.1.51
48
22
  Requires-Dist: masterpiece_influx>=0.1.9
49
23
  Requires-Dist: masterpiece_pahomqtt>=0.1.5
50
24
  Requires-Dist: requests>=2.31
@@ -0,0 +1,78 @@
1
+ Changelog
2
+ =========
3
+
4
+
5
+ [0.2.3] - November, 26 2025
6
+ ---------------------------
7
+
8
+ - Logging improved: if mqtt topic of the incoming message is not recongized then log the topic and the message.
9
+
10
+
11
+
12
+ [0.2.1] - November, 22 2025
13
+ ---------------------------
14
+
15
+ - Support for supervisor thread added. The thread listens thread crash reports,
16
+ logs them and restarts the crashed threads.
17
+
18
+
19
+ [0.1.7] - November, 15 2025
20
+ ---------------------------
21
+
22
+ - Package version number and dependencies updated, no functional changes.
23
+
24
+
25
+ [0.1.6] - October, 31 2025
26
+ --------------------------
27
+
28
+ - Added `elapsed_seconds_in_interval()` to `timeutils`.
29
+ - Generalized `elapsed_seconds_in_hour()` and `elapsed_seconds_in_day()` to use the new method.
30
+
31
+
32
+
33
+ [0.1.4] - March, 09 2025
34
+ ------------------------
35
+
36
+ - ``pyproject.toml`` - dependencies updated
37
+
38
+
39
+ [0.1.1] - March, 03 2025
40
+ ------------------------
41
+
42
+ - Redundancy eliminated from the bloated Sphinx conf.py.
43
+
44
+
45
+ [0.0.8] - March, 02 2025
46
+ ------------------------
47
+
48
+ - Documentation refactored.
49
+
50
+
51
+ [0.0.5, 0.0.6] - February, 16 2025
52
+ ----------------------------------
53
+
54
+ - References to optional plugins removed from the example application ``examples/myapp.py``.
55
+
56
+ - Version of the ``masterpiece`` dependency updated.
57
+
58
+ - ``README.rst`` updated.
59
+
60
+
61
+
62
+ [0.0.4] - February, 14 2025
63
+ ---------------------------
64
+
65
+ - Time zone bug in timeutils.py fixed.
66
+
67
+
68
+ [0.0.3] - January, 25 2025
69
+ --------------------------
70
+
71
+ - **Refactorization:** Class names renamed for consistency.
72
+
73
+
74
+ [0.0.1] - January, 25 2025
75
+ --------------------------
76
+
77
+ - **Initial release:** ``Juham`` base class with MQTT and Timeseries abstraction.
78
+
@@ -0,0 +1,44 @@
1
+ Contributing to Juham™ - Juha's Ultimate Home Automation Masterpiece
2
+ ====================================================================
3
+
4
+ Thank You!
5
+ ----------
6
+
7
+ Thank you in advance for your forthcoming contributions, whether they are bug fixes,
8
+ documentation improvements, entirely new features, or simply feedback. Your efforts
9
+ will be highly appreciated and will help turn this project from its current mission
10
+ state into an actual masterpiece.
11
+
12
+
13
+ Design Patterns
14
+ ---------------
15
+
16
+ Please read the developer documentation and understand the few design patterns behind Juham™ before contributing.
17
+ This will help ensure that your contributions align with the project's design and goals.
18
+ .. todo:: (okay, the documentation is currently lacking many essential chapters, add.)
19
+
20
+
21
+ Code Formatting
22
+ ---------------
23
+
24
+ To help maintain consistent code formatting across different developers, we use 'black' python formatter, by Microsoft.
25
+
26
+ Strange, the formatter doesn't seem to format that much, it doesn't organize imports,
27
+ doesn't adjust docstring lenghts
28
+ .. todo:: most likely I don't know how to use it properly, read the docs.
29
+
30
+
31
+ Using Emacs and Makefile
32
+ ------------------------
33
+
34
+ Despite my attempts to fall in love with Eclipse, VSCode and other IDEs, I still find Emacs and Makefile the best
35
+ tools for many workflows.
36
+ So there is a Makefile in the root folder. For those old dogs who are like me
37
+ ::
38
+
39
+ make help
40
+
41
+ More Stuff
42
+ ----------
43
+ .. todo:: TBA
44
+
@@ -0,0 +1,25 @@
1
+ LICENSE
2
+ =======
3
+
4
+ Copyright (c) 2024, Juha Meskanen
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ "Software"), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ **The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.**
16
+
17
+
18
+ ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **
25
+
@@ -0,0 +1,38 @@
1
+ Welcome to Juham™ - Juha's Ultimate Home Automation Core
2
+ ========================================================
3
+
4
+ Description
5
+ -----------
6
+
7
+ ``juham-core`` extends the functionality of ``Masterpiece`` object by adding capabilities for MQTT
8
+ communication and integration with time series databases. The base class provides only a minimal
9
+ set of interfaces. Actual features, such as MQTT and time series database implementations — along with home
10
+ automation-specific functionalities — are provided through separate plugin modules built on ``juham-core`` class.
11
+
12
+
13
+ Project Status and Goals
14
+ ------------------------
15
+
16
+ **Current State**: **Beta (Status 4)**
17
+
18
+ The aim of Juham™ is to have fun learning Python and the GitLab ecosystem while developing a home automation framework capable of controlling all devices in Juha's home, with the potential to be adapted for other homes as well.
19
+
20
+ In its current form, Juham™ no longer stands for a “mess,” though it isn’t quite a “masterpiece” yet either. Still working hard to turn it into a masterpiece!
21
+
22
+
23
+
24
+ Special Thanks
25
+ --------------
26
+
27
+ This project would not have been possible without the generous support of two exceptional individuals: Teppo K. and Mahi.
28
+
29
+ Teppo K. provided the initial spark for this project by donating a Raspberry Pi, a temperature sensor, and giving an inspiring
30
+ demonstration of his own home automation system—effectively dragging me down the rabbit hole of endless tinkering.
31
+
32
+ Mahi has been instrumental in translating my half-baked ideas into Python code, offering invaluable support and
33
+ encouragement—while also ensuring that every time I thought I was done, I wasn’t.
34
+
35
+ Because of these two gentlemen, my already minimal spare time dropped into the negatives as I desperately tried to push the
36
+ system to some semblance of professionalism.
37
+
38
+ I’m truly grateful to both—really. 😅
@@ -161,12 +161,19 @@ class Juham(MasterPiece):
161
161
 
162
162
  m = json.loads(msg.payload)
163
163
  if msg.topic == self.mqtt_topic_control:
164
- if m["command"] == "shutdown" and self.mqtt_client:
165
- self.info(f"{self.name} shutting down on command")
166
- self.mqtt_client.disconnect()
167
- self.mqtt_client.loop_stop()
164
+ if m["command"] == "shutdown":
165
+ if self.mqtt_client:
166
+ self.info(f"{self.name} shutting down on command")
167
+ self.mqtt_client.disconnect()
168
+ self.mqtt_client.loop_stop()
169
+ else:
170
+ self.warning(f"No mqtt client {msg.topic}", m)
171
+ else:
172
+ self.error(f"Unknown command {msg.topic}", m)
168
173
  else:
169
- self.warning(f"{self.name} unknown topic {msg.topic}, {m} ")
174
+ self.warning(f"Unknown topic {msg.topic}",m)
175
+
176
+
170
177
 
171
178
 
172
179
  def on_connect(self, client: object, userdata: Any, flags: int, rc: int) -> None:
@@ -33,7 +33,7 @@ class JuhamThread(JuhamTs):
33
33
 
34
34
  """
35
35
 
36
- _systemstatus_topic : str = "status"
36
+ _systemstatus_topic : str = "status" # TODO: design bug: should not be here
37
37
  _error_queue : Queue = Queue()
38
38
  _supervisor: Optional["SupervisorThread"] = None
39
39
 
@@ -1,35 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: juham-core
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Juha's Ultimate Home Automation Core
5
5
  Author-email: J Meskanen <juham.api@gmail.com>
6
6
  Maintainer-email: "J. Meskanen" <juham.api@gmail.com>
7
- License: LICENSE
8
- =======
9
-
10
- Copyright (c) 2024, Juha Meskanen
11
-
12
- Permission is hereby granted, free of charge, to any person obtaining
13
- a copy of this software and associated documentation files (the
14
- "Software"), to deal in the Software without restriction, including
15
- without limitation the rights to use, copy, modify, merge, publish,
16
- distribute, sublicense, and/or sell copies of the Software, and to
17
- permit persons to whom the Software is furnished to do so, subject to
18
- the following conditions:
19
-
20
- **The above copyright notice and this permission notice shall be included in all
21
- copies or substantial portions of the Software.**
22
-
23
-
24
- ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
27
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
28
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
30
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **
31
-
32
-
7
+ License-Expression: MIT
33
8
  Project-URL: Homepage, https://gitlab.com/juham/juham/juham_core
34
9
  Project-URL: Bug Reports, https://gitlab.com/juham/juham/juham_core
35
10
  Project-URL: Funding, https://meskanen.com
@@ -39,12 +14,11 @@ Keywords: home,automation,juham
39
14
  Classifier: Development Status :: 4 - Beta
40
15
  Classifier: Intended Audience :: Developers
41
16
  Classifier: Topic :: Software Development
42
- Classifier: License :: Public Domain
43
17
  Classifier: Programming Language :: Python :: 3.8
44
18
  Requires-Python: >=3.8
45
19
  Description-Content-Type: text/markdown
46
20
  License-File: LICENSE.rst
47
- Requires-Dist: masterpiece>=0.1.48
21
+ Requires-Dist: masterpiece>=0.1.51
48
22
  Requires-Dist: masterpiece_influx>=0.1.9
49
23
  Requires-Dist: masterpiece_pahomqtt>=0.1.5
50
24
  Requires-Dist: requests>=2.31
@@ -0,0 +1,32 @@
1
+ LICENSE.rst
2
+ MANIFEST.in
3
+ README.rst
4
+ pyproject.toml
5
+ docs/source/CHANGELOG.rst
6
+ docs/source/CONTRIBUTING.rst
7
+ docs/source/LICENSE.rst
8
+ docs/source/README.rst
9
+ examples/myapp.py
10
+ juham_core/__init__.py
11
+ juham_core/juham.py
12
+ juham_core/juham_cloud.py
13
+ juham_core/juham_thread.py
14
+ juham_core/juham_ts.py
15
+ juham_core/py.typed
16
+ juham_core/timeutils.py
17
+ juham_core.egg-info/PKG-INFO
18
+ juham_core.egg-info/SOURCES.txt
19
+ juham_core.egg-info/dependency_links.txt
20
+ juham_core.egg-info/requires.txt
21
+ juham_core.egg-info/top_level.txt
22
+ tests/__init__.py
23
+ tests/test_juham.py
24
+ tests/test_juham_ts.py
25
+ tests/test_timeutils.py
26
+ tests/__pycache__/__init__.cpython-312.pyc
27
+ tests/__pycache__/test_juham.cpython-312-pytest-9.0.1.pyc
28
+ tests/__pycache__/test_juham.cpython-312.pyc
29
+ tests/__pycache__/test_juham_ts.cpython-312-pytest-9.0.1.pyc
30
+ tests/__pycache__/test_juham_ts.cpython-312.pyc
31
+ tests/__pycache__/test_timeutils.cpython-312-pytest-9.0.1.pyc
32
+ tests/__pycache__/test_timeutils.cpython-312.pyc
@@ -1,4 +1,4 @@
1
- masterpiece>=0.1.48
1
+ masterpiece>=0.1.51
2
2
  masterpiece_influx>=0.1.9
3
3
  masterpiece_pahomqtt>=0.1.5
4
4
  requests>=2.31
@@ -7,11 +7,11 @@ include-package-data = true
7
7
 
8
8
  [project]
9
9
  name = "juham-core"
10
- version = "0.2.2"
10
+ version = "0.2.4"
11
11
  description = "Juha's Ultimate Home Automation Core"
12
12
  readme = {file = "README.rst", content-type = "text/markdown"}
13
13
  requires-python = ">=3.8"
14
- license = {file = "LICENSE.rst", content-type = "text/markdown"}
14
+ license = "MIT"
15
15
  keywords = ["home", "automation", "juham"]
16
16
  authors = [
17
17
  {name = "J Meskanen", email = "juham.api@gmail.com" }
@@ -24,12 +24,11 @@ classifiers = [
24
24
  "Development Status :: 4 - Beta",
25
25
  "Intended Audience :: Developers",
26
26
  "Topic :: Software Development",
27
- "License :: Public Domain",
28
27
  "Programming Language :: Python :: 3.8",
29
28
  ]
30
29
 
31
30
  dependencies = [
32
- "masterpiece >= 0.1.48",
31
+ "masterpiece >= 0.1.51",
33
32
  "masterpiece_influx >= 0.1.9",
34
33
  "masterpiece_pahomqtt >= 0.1.5",
35
34
  "requests >= 2.31",
@@ -1,21 +0,0 @@
1
- LICENSE.rst
2
- MANIFEST.in
3
- README.rst
4
- pyproject.toml
5
- examples/myapp.py
6
- juham_core/__init__.py
7
- juham_core/juham.py
8
- juham_core/juham_cloud.py
9
- juham_core/juham_thread.py
10
- juham_core/juham_ts.py
11
- juham_core/py.typed
12
- juham_core/timeutils.py
13
- juham_core.egg-info/PKG-INFO
14
- juham_core.egg-info/SOURCES.txt
15
- juham_core.egg-info/dependency_links.txt
16
- juham_core.egg-info/requires.txt
17
- juham_core.egg-info/top_level.txt
18
- tests/__init__.py
19
- tests/test_juham.py
20
- tests/test_juham_ts.py
21
- tests/test_timeutils.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes