Fix ip of KasaPowerStrip in livingroom
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,5 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
|
.venv
|
||||||
|
.secrect
|
||||||
|
uv.lock
|
||||||
dockerfiles/dataExporter/code
|
dockerfiles/dataExporter/code
|
||||||
|
|||||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.13
|
||||||
@@ -3,6 +3,7 @@ from kasa.exceptions import KasaException
|
|||||||
|
|
||||||
from . import KasaSmartPowerStrip
|
from . import KasaSmartPowerStrip
|
||||||
from .utilities import log as log
|
from .utilities import log as log
|
||||||
|
from .utilities import logE
|
||||||
|
|
||||||
|
|
||||||
class KasaPowerStrip:
|
class KasaPowerStrip:
|
||||||
@@ -11,8 +12,10 @@ class KasaPowerStrip:
|
|||||||
self.ip = ip
|
self.ip = ip
|
||||||
try:
|
try:
|
||||||
self.powerStrip = KasaSmartPowerStrip.SmartPowerStrip(ip)
|
self.powerStrip = KasaSmartPowerStrip.SmartPowerStrip(ip)
|
||||||
|
log(f'KasaPowerStrip connected({areaName}, {ip}).')
|
||||||
except:
|
except:
|
||||||
self.powerStrip = None
|
self.powerStrip = None
|
||||||
|
logE(f'KasaPowerStrip connect fail({areaName}, {ip}).')
|
||||||
|
|
||||||
def collectData(self):
|
def collectData(self):
|
||||||
dataDict = {}
|
dataDict = {}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ def main(configs):
|
|||||||
|
|
||||||
hddTempExporter = HddTempDataExporter()
|
hddTempExporter = HddTempDataExporter()
|
||||||
cpuFanTempExporter = CpuFanTempDataExporter()
|
cpuFanTempExporter = CpuFanTempDataExporter()
|
||||||
powerStripLivingroomExporter = KasaPowerStripDataExporter("livingroom", "192.168.1.203")
|
powerStripLivingroomExporter = KasaPowerStripDataExporter("livingroom", "192.168.1.204")
|
||||||
powerStripAtticExporter = KasaPowerStripDataExporter("attic", "192.168.1.202")
|
powerStripAtticExporter = KasaPowerStripDataExporter("attic", "192.168.1.202")
|
||||||
t315Atticexporter = TapoT315DataExporter(secrect["ip"], secrect["username"], secrect["password"], "鐵皮屋-溫濕度感測器", "attic-sensors")
|
t315Atticexporter = TapoT315DataExporter(secrect["ip"], secrect["username"], secrect["password"], "鐵皮屋-溫濕度感測器", "attic-sensors")
|
||||||
gaugeDict = {}
|
gaugeDict = {}
|
||||||
|
|||||||
12
pyproject.toml
Normal file
12
pyproject.toml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[project]
|
||||||
|
name = "linux-script"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Add your description here"
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.13"
|
||||||
|
dependencies = [
|
||||||
|
"prometheus-client>=0.21.1",
|
||||||
|
"python-kasa>=0.10.2",
|
||||||
|
"rich>=14.0.0",
|
||||||
|
"schedule>=1.2.2",
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user