Fix ip of KasaPowerStrip in livingroom

This commit is contained in:
2025-04-10 00:01:07 +08:00
parent b6986bf29c
commit 7ac720d8df
6 changed files with 20 additions and 1 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,5 @@
__pycache__
.venv
.secrect
uv.lock
dockerfiles/dataExporter/code

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.13

0
README.md Normal file
View File

View File

@@ -3,6 +3,7 @@ from kasa.exceptions import KasaException
from . import KasaSmartPowerStrip
from .utilities import log as log
from .utilities import logE
class KasaPowerStrip:
@@ -11,8 +12,10 @@ class KasaPowerStrip:
self.ip = ip
try:
self.powerStrip = KasaSmartPowerStrip.SmartPowerStrip(ip)
log(f'KasaPowerStrip connected({areaName}, {ip}).')
except:
self.powerStrip = None
logE(f'KasaPowerStrip connect fail({areaName}, {ip}).')
def collectData(self):
dataDict = {}

View File

@@ -55,7 +55,7 @@ def main(configs):
hddTempExporter = HddTempDataExporter()
cpuFanTempExporter = CpuFanTempDataExporter()
powerStripLivingroomExporter = KasaPowerStripDataExporter("livingroom", "192.168.1.203")
powerStripLivingroomExporter = KasaPowerStripDataExporter("livingroom", "192.168.1.204")
powerStripAtticExporter = KasaPowerStripDataExporter("attic", "192.168.1.202")
t315Atticexporter = TapoT315DataExporter(secrect["ip"], secrect["username"], secrect["password"], "鐵皮屋-溫濕度感測器", "attic-sensors")
gaugeDict = {}

12
pyproject.toml Normal file
View 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",
]