Skip to content

Commit

Permalink
clean prints when sending via hass api (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjelev authored Dec 6, 2024
1 parent a4745ab commit 3cf041f
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/rpi-cpu2mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ def on_connect(client, userdata, flags, rc):


def publish_update_status_to_mqtt(git_update, apt_updates):

client = create_mqtt_client()
if client is None:
print("Error: Unable to connect to MQTT broker")
Expand Down Expand Up @@ -661,8 +660,6 @@ def publish_update_status_to_mqtt(git_update, apt_updates):
def publish_to_hass_api(monitored_values):
for param, value in monitored_values.items():
if value:
print(param, value)
print(config_json(param, "0", True))
if param == 'drive_temps' and isinstance(value, dict):
for device, temp in value.items():
entity_id = f"sensor.{hostname.replace('-','_')}_{device}_temp"
Expand All @@ -677,7 +674,6 @@ def publish_to_hass_api(monitored_values):


def send_sensor_data_to_home_assistant(entity_id, state, attributes):

home_assistant_url = config.hass_host
api_token = config.hass_token
url = f"{home_assistant_url}/api/states/{entity_id}"
Expand Down Expand Up @@ -814,13 +810,6 @@ def parse_arguments():

if args.update:
version = update.check_git_version_remote(script_dir).strip()
git_update = check_git_update(script_dir)

# if git_update == 'on':
# git_update = True
# else:
# git_update = False

update.do_update(script_dir, version, True)

exit()
Expand Down

0 comments on commit 3cf041f

Please sign in to comment.