redis test 1

This commit is contained in:
matt committed 2026-10-13 02:35:22 -07:00
1 parent 66e022bafe
commit 839f7602df
5 files changed
+46 -3

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import redis
import json
from config.py import *
####################################################
### Redis Functions
####################################################
if enable_redis:
r = redis.Redis(host=bind_ip, port=redis_port)
def update_redis(data):
# push data to redis
# Publish to the Redis channel that the WS server is listening on
r.publish('temp_hum', json.dumps(data))
if debug_output:
print("=== Stats Redis Update ===")
print(json.dumps(data, indent=2))
return True