juham-core 0.2.2__tar.gz → 0.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.
- {juham_core-0.2.2/juham_core.egg-info → juham_core-0.2.3}/PKG-INFO +1 -1
- juham_core-0.2.3/docs/source/CHANGELOG.rst +72 -0
- juham_core-0.2.3/docs/source/CONTRIBUTING.rst +44 -0
- juham_core-0.2.3/docs/source/LICENSE.rst +25 -0
- juham_core-0.2.3/docs/source/README.rst +38 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core/juham.py +10 -5
- {juham_core-0.2.2 → juham_core-0.2.3/juham_core.egg-info}/PKG-INFO +1 -1
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core.egg-info/SOURCES.txt +9 -1
- {juham_core-0.2.2 → juham_core-0.2.3}/pyproject.toml +1 -1
- juham_core-0.2.3/tests/__pycache__/__init__.cpython-312.pyc +0 -0
- juham_core-0.2.3/tests/__pycache__/test_juham.cpython-312.pyc +0 -0
- juham_core-0.2.3/tests/__pycache__/test_juham_ts.cpython-312.pyc +0 -0
- juham_core-0.2.3/tests/__pycache__/test_timeutils.cpython-312.pyc +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/LICENSE.rst +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/MANIFEST.in +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/README.rst +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/examples/myapp.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core/__init__.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core/juham_cloud.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core/juham_thread.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core/juham_ts.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core/py.typed +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core/timeutils.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core.egg-info/dependency_links.txt +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core.egg-info/requires.txt +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/juham_core.egg-info/top_level.txt +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/setup.cfg +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/tests/__init__.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/tests/test_juham.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/tests/test_juham_ts.py +0 -0
- {juham_core-0.2.2 → juham_core-0.2.3}/tests/test_timeutils.py +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Changelog
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[0.2.1] - November, 22 2025
|
|
7
|
+
---------------------------
|
|
8
|
+
|
|
9
|
+
- Support for supervisor thread added. The thread listens thread crash reports,
|
|
10
|
+
logs them and restarts the crashed threads.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
[0.1.7] - November, 15 2025
|
|
14
|
+
---------------------------
|
|
15
|
+
|
|
16
|
+
- Package version number and dependencies updated, no functional changes.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
[0.1.6] - October, 31 2025
|
|
20
|
+
--------------------------
|
|
21
|
+
|
|
22
|
+
- Added `elapsed_seconds_in_interval()` to `timeutils`.
|
|
23
|
+
- Generalized `elapsed_seconds_in_hour()` and `elapsed_seconds_in_day()` to use the new method.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
[0.1.4] - March, 09 2025
|
|
28
|
+
------------------------
|
|
29
|
+
|
|
30
|
+
- ``pyproject.toml`` - dependencies updated
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
[0.1.1] - March, 03 2025
|
|
34
|
+
------------------------
|
|
35
|
+
|
|
36
|
+
- Redundancy eliminated from the bloated Sphinx conf.py.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[0.0.8] - March, 02 2025
|
|
40
|
+
------------------------
|
|
41
|
+
|
|
42
|
+
- Documentation refactored.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
[0.0.5, 0.0.6] - February, 16 2025
|
|
46
|
+
----------------------------------
|
|
47
|
+
|
|
48
|
+
- References to optional plugins removed from the example application ``examples/myapp.py``.
|
|
49
|
+
|
|
50
|
+
- Version of the ``masterpiece`` dependency updated.
|
|
51
|
+
|
|
52
|
+
- ``README.rst`` updated.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
[0.0.4] - February, 14 2025
|
|
57
|
+
---------------------------
|
|
58
|
+
|
|
59
|
+
- Time zone bug in timeutils.py fixed.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
[0.0.3] - January, 25 2025
|
|
63
|
+
--------------------------
|
|
64
|
+
|
|
65
|
+
- **Refactorization:** Class names renamed for consistency.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
[0.0.1] - January, 25 2025
|
|
69
|
+
--------------------------
|
|
70
|
+
|
|
71
|
+
- **Initial release:** ``Juham`` base class with MQTT and Timeseries abstraction.
|
|
72
|
+
|
|
@@ -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,17 @@ 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"
|
|
165
|
-
self.
|
|
166
|
-
|
|
167
|
-
|
|
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"
|
|
174
|
+
self.warning(f"Unknown topic {msg.topic}",m)
|
|
170
175
|
|
|
171
176
|
|
|
172
177
|
def on_connect(self, client: object, userdata: Any, flags: int, rc: int) -> None:
|
|
@@ -2,6 +2,10 @@ LICENSE.rst
|
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.rst
|
|
4
4
|
pyproject.toml
|
|
5
|
+
docs/source/CHANGELOG.rst
|
|
6
|
+
docs/source/CONTRIBUTING.rst
|
|
7
|
+
docs/source/LICENSE.rst
|
|
8
|
+
docs/source/README.rst
|
|
5
9
|
examples/myapp.py
|
|
6
10
|
juham_core/__init__.py
|
|
7
11
|
juham_core/juham.py
|
|
@@ -18,4 +22,8 @@ juham_core.egg-info/top_level.txt
|
|
|
18
22
|
tests/__init__.py
|
|
19
23
|
tests/test_juham.py
|
|
20
24
|
tests/test_juham_ts.py
|
|
21
|
-
tests/test_timeutils.py
|
|
25
|
+
tests/test_timeutils.py
|
|
26
|
+
tests/__pycache__/__init__.cpython-312.pyc
|
|
27
|
+
tests/__pycache__/test_juham.cpython-312.pyc
|
|
28
|
+
tests/__pycache__/test_juham_ts.cpython-312.pyc
|
|
29
|
+
tests/__pycache__/test_timeutils.cpython-312.pyc
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|