new line add
This commit is contained in:
@@ -205,14 +205,14 @@ def main(debug=False, update_db=True):
|
|||||||
customer_data[customer_name]['power_watts'] += sensor_value
|
customer_data[customer_name]['power_watts'] += sensor_value
|
||||||
|
|
||||||
total_power_kw = total_power_watts / 1000 # Convert watts to kilowatts
|
total_power_kw = total_power_watts / 1000 # Convert watts to kilowatts
|
||||||
print(f"Total Current: {round(total_current, 3)} A")
|
print(f"\n\nTotal Current: {round(total_current, 3)} A")
|
||||||
print(f"Total Power: {round(total_power_kw, 3)} kW")
|
print(f"Total Power: {round(total_power_kw, 3)} kW")
|
||||||
|
|
||||||
# Insert building total data into the database if update_db is True
|
# Insert building total data into the database if update_db is True
|
||||||
if update_db:
|
if update_db:
|
||||||
insert_building_total(conn, total_current, total_power_kw)
|
insert_building_total(conn, total_current, total_power_kw)
|
||||||
|
|
||||||
print("\nBreakdown by Room:")
|
print("\n\nBreakdown by Room:\n")
|
||||||
for room, current in room_current.items():
|
for room, current in room_current.items():
|
||||||
power_kw = room_power[room] / 1000 # Convert watts to kilowatts
|
power_kw = room_power[room] / 1000 # Convert watts to kilowatts
|
||||||
print(f"Room {room}: Current = {round(current, 3)} A, Power = {round(power_kw, 3)} kW")
|
print(f"Room {room}: Current = {round(current, 3)} A, Power = {round(power_kw, 3)} kW")
|
||||||
@@ -221,7 +221,7 @@ def main(debug=False, update_db=True):
|
|||||||
if update_db:
|
if update_db:
|
||||||
insert_room_breakdown(conn, room, current, power_kw)
|
insert_room_breakdown(conn, room, current, power_kw)
|
||||||
|
|
||||||
print("\nCustomer Breakdown:")
|
print("\n\nCustomer Breakdown:\n")
|
||||||
for customer_name, data in customer_data.items():
|
for customer_name, data in customer_data.items():
|
||||||
power_kw = data['power_watts'] / 1000 # Convert watts to kilowatts
|
power_kw = data['power_watts'] / 1000 # Convert watts to kilowatts
|
||||||
print(f"Customer {customer_name} - Current: {round(data['current'], 3)} A, Power: {round(power_kw, 3)} kW")
|
print(f"Customer {customer_name} - Current: {round(data['current'], 3)} A, Power: {round(power_kw, 3)} kW")
|
||||||
|
|||||||
Reference in New Issue
Block a user