Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean prints when sending via hass api #173

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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