kerttula 0.0.1__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.
- kerttula-0.0.1/PKG-INFO +27 -0
- kerttula-0.0.1/kerttula/kerttula.py +95 -0
- kerttula-0.0.1/kerttula.egg-info/PKG-INFO +27 -0
- kerttula-0.0.1/kerttula.egg-info/SOURCES.txt +9 -0
- kerttula-0.0.1/kerttula.egg-info/dependency_links.txt +1 -0
- kerttula-0.0.1/kerttula.egg-info/entry_points.txt +2 -0
- kerttula-0.0.1/kerttula.egg-info/requires.txt +9 -0
- kerttula-0.0.1/kerttula.egg-info/top_level.txt +1 -0
- kerttula-0.0.1/kerttula.service +16 -0
- kerttula-0.0.1/pyproject.toml +61 -0
- kerttula-0.0.1/setup.cfg +4 -0
kerttula-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: kerttula
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Juha's home
|
|
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: home,automation,juham,masterpiece
|
|
13
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Software Development
|
|
16
|
+
Classifier: License :: Public Domain
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
Requires-Dist: juham>=0.0.4
|
|
21
|
+
Requires-Dist: juham_visualcrossing>=0.0.1
|
|
22
|
+
Requires-Dist: juham_priceforecast>=0.0.1
|
|
23
|
+
Requires-Dist: juham_openweathermap>=0.0.1
|
|
24
|
+
Requires-Dist: pytz>=2024.1
|
|
25
|
+
Requires-Dist: importlib-metadata
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: check-manifest; extra == "dev"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from masterpiece.core import MasterPiece, Application, Log
|
|
2
|
+
from juham.base.base import Base
|
|
3
|
+
from juham.base.jmqtt import JMqtt
|
|
4
|
+
from juham.database import JInflux
|
|
5
|
+
from juham.mqtt import JPaho2
|
|
6
|
+
|
|
7
|
+
from juham.ts import ForecastRecord
|
|
8
|
+
from juham.ts import PowerRecord
|
|
9
|
+
from juham.ts import PowerPlanRecord
|
|
10
|
+
from juham.ts import LogRecord
|
|
11
|
+
from juham.web import RSpotHintaFi
|
|
12
|
+
|
|
13
|
+
# from juham.web import RVisualCrossing
|
|
14
|
+
|
|
15
|
+
from juham.web import HomeWizardWaterMeter
|
|
16
|
+
from juham.shelly import ShellyPlus1
|
|
17
|
+
from juham.shelly import Shelly1G3
|
|
18
|
+
from juham.shelly import ShellyPro3EM
|
|
19
|
+
from juham.shelly import ShellyMotion
|
|
20
|
+
from juham.automation import RPowerPlan
|
|
21
|
+
from juham.automation import RBoiler
|
|
22
|
+
from juham.automation import WaterCirculator
|
|
23
|
+
from juham.automation import EnergyCostCalculator
|
|
24
|
+
from juham.base import JApp
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Kerttula(JApp):
|
|
28
|
+
"""Kerttula home automation application."""
|
|
29
|
+
|
|
30
|
+
shelly_temperature = "shellyplus1-a0a3b3c309c4" # temperature sensors
|
|
31
|
+
shelly_boilerradiator = "shellyplus1-alakerta" # hot water heating relay
|
|
32
|
+
|
|
33
|
+
def __init__(self, name: str = "kerttula"):
|
|
34
|
+
"""Creates home automation application with the given name.
|
|
35
|
+
If --enable_plugins is False create hard coded configuration
|
|
36
|
+
by calling instantiate_classes() method.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
name (str): name for the application
|
|
40
|
+
"""
|
|
41
|
+
super().__init__(name)
|
|
42
|
+
self.instantiate_classes()
|
|
43
|
+
|
|
44
|
+
# @override
|
|
45
|
+
def instantiate_classes(self):
|
|
46
|
+
super().instantiate_classes()
|
|
47
|
+
self.add(ForecastRecord())
|
|
48
|
+
self.add(PowerRecord())
|
|
49
|
+
self.add(PowerPlanRecord())
|
|
50
|
+
self.add(LogRecord())
|
|
51
|
+
self.add(RSpotHintaFi())
|
|
52
|
+
self.add(HomeWizardWaterMeter())
|
|
53
|
+
self.add(ShellyPlus1(self.shelly_temperature)) # for temperature sensors
|
|
54
|
+
self.add(ShellyPlus1(self.shelly_boilerradiator)) # boiler heating radiator
|
|
55
|
+
self.add(Shelly1G3()) # humidity
|
|
56
|
+
self.add(ShellyPro3EM())
|
|
57
|
+
self.add(ShellyMotion())
|
|
58
|
+
self.add(RPowerPlan())
|
|
59
|
+
self.add(RBoiler())
|
|
60
|
+
self.add(WaterCirculator())
|
|
61
|
+
self.add(EnergyCostCalculator())
|
|
62
|
+
|
|
63
|
+
# pluginized
|
|
64
|
+
self.instantiate_plugin_by_name("VisualCrossing")
|
|
65
|
+
self.instantiate_plugin_by_name("OpenWeatherMap")
|
|
66
|
+
self.print()
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def register(cls):
|
|
70
|
+
appname = "kerttula"
|
|
71
|
+
MasterPiece.app_name(appname)
|
|
72
|
+
MasterPiece.set_log(Log(appname))
|
|
73
|
+
Application.register_plugin_group(appname)
|
|
74
|
+
Application.load_class_attributes()
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def main():
|
|
78
|
+
|
|
79
|
+
# Support plugins
|
|
80
|
+
Kerttula.load_plugins()
|
|
81
|
+
|
|
82
|
+
# Parse startup arguments
|
|
83
|
+
Kerttula.parse_args()
|
|
84
|
+
|
|
85
|
+
# instantiate the application
|
|
86
|
+
app = Kerttula()
|
|
87
|
+
|
|
88
|
+
# app.serialize()
|
|
89
|
+
|
|
90
|
+
# start the network loops
|
|
91
|
+
app.run_forever()
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
if __name__ == "__main__":
|
|
95
|
+
main()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: kerttula
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Juha's home
|
|
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: home,automation,juham,masterpiece
|
|
13
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Software Development
|
|
16
|
+
Classifier: License :: Public Domain
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
Requires-Dist: juham>=0.0.4
|
|
21
|
+
Requires-Dist: juham_visualcrossing>=0.0.1
|
|
22
|
+
Requires-Dist: juham_priceforecast>=0.0.1
|
|
23
|
+
Requires-Dist: juham_openweathermap>=0.0.1
|
|
24
|
+
Requires-Dist: pytz>=2024.1
|
|
25
|
+
Requires-Dist: importlib-metadata
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: check-manifest; extra == "dev"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
kerttula
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[Unit]
|
|
2
|
+
Description=Home Automation service
|
|
3
|
+
After=network.target
|
|
4
|
+
|
|
5
|
+
[Service]
|
|
6
|
+
Type=simple
|
|
7
|
+
ExecStart=/usr/bin/kerttula --log_name /var/log/kerttula.log
|
|
8
|
+
User=pi
|
|
9
|
+
Group=pi
|
|
10
|
+
Restart=on-failure
|
|
11
|
+
SyslogIdentifier=/home/pi/kerttula/kerttula.log
|
|
12
|
+
RestartSec=5
|
|
13
|
+
TimeoutStartSec=infinity
|
|
14
|
+
|
|
15
|
+
[Install]
|
|
16
|
+
WantedBy=multi-user.target
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "kerttula"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "Juha's home"
|
|
9
|
+
readme = {file = "docs/source/README.rst", content-type = "text/markdown"}
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = {file = "docs/source/LICENSE.rst", content-type = "text/markdown"}
|
|
12
|
+
keywords = ["home", "automation", "juham", "masterpiece"]
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "J Meskanen", email = "juham.api@gmail.com" }
|
|
15
|
+
]
|
|
16
|
+
maintainers = [
|
|
17
|
+
{name = "J. Meskanen", email = "juham.api@gmail.com" }
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
22
|
+
"Intended Audience :: Developers",
|
|
23
|
+
"Topic :: Software Development",
|
|
24
|
+
"License :: Public Domain",
|
|
25
|
+
"Programming Language :: Python :: 3.8",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
dependencies = [
|
|
29
|
+
"juham >= 0.0.4",
|
|
30
|
+
"juham_visualcrossing >= 0.0.1",
|
|
31
|
+
"juham_priceforecast >= 0.0.1",
|
|
32
|
+
"juham_openweathermap >= 0.0.1",
|
|
33
|
+
"pytz >= 2024.1",
|
|
34
|
+
"importlib-metadata"
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
# Add kerttula to path so that kerttula.service can find and start it
|
|
38
|
+
[project.scripts]
|
|
39
|
+
kerttula = "kerttula.kerttula:main"
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
dev = ["check-manifest"]
|
|
43
|
+
|
|
44
|
+
[project.entry-points."kerttula.plugins"]
|
|
45
|
+
# none, yet
|
|
46
|
+
|
|
47
|
+
[project.urls]
|
|
48
|
+
"Homepage" = "https://meskanen.com"
|
|
49
|
+
"Bug Reports" = "https://meskanen.com"
|
|
50
|
+
"Funding" = "https://meskanen.com"
|
|
51
|
+
"Say Thanks!" = "http://meskanen.com"
|
|
52
|
+
"Source" = "https://meskanen.com"
|
|
53
|
+
|
|
54
|
+
# Add service file installation
|
|
55
|
+
[tool.setuptools.data-files]
|
|
56
|
+
# This installs the kerttula.service to /etc/systemd/system
|
|
57
|
+
"/etc/systemd/system" = ["kerttula.service"]
|
|
58
|
+
|
|
59
|
+
[tool.mypy]
|
|
60
|
+
files = ["kerttula/*.py", "tests/*.py"]
|
|
61
|
+
ignore_missing_imports = true
|
kerttula-0.0.1/setup.cfg
ADDED