Skip to content

Commit

Permalink
Disable the new machine update sensors by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Tremblay committed Dec 5, 2023
1 parent 6303226 commit f800681
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions custom_components/moonraker/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async def async_setup_update_binary_sensors(coordinator, entry, async_add_entiti
subscriptions=[("status", "update_available")],
icon="mdi:update",
device_class=BinarySensorDeviceClass.UPDATE,
entity_registry_enabled_default=False,
)

coordinator.load_sensor_data([desc])
Expand Down
4 changes: 3 additions & 1 deletion custom_components/moonraker/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ async def async_setup_machine_update_sensors(coordinator, entry, async_add_entit
value_fn=lambda sensor: f"{sensor.coordinator.data['machine_update']['version_info']['system']['package_count']} packages can be upgraded",
subscriptions=[],
icon="mdi:update",
entity_registry_enabled_default=False,
)
]

Expand All @@ -510,7 +511,7 @@ async def async_setup_machine_update_sensors(coordinator, entry, async_add_entit
sensors.append(
MoonrakerSensorDescription(
key=f"machine_update_{version_info}",
name=f"{version_info.title()}",
name=f"Version {version_info.title()}",
status_key=version_info,
value_fn=lambda sensor: (lambda v, rv: f"{v} > {rv}" if v != rv else v)(
sensor.coordinator.data["machine_update"]["version_info"][
Expand All @@ -522,6 +523,7 @@ async def async_setup_machine_update_sensors(coordinator, entry, async_add_entit
),
subscriptions=[],
icon="mdi:update",
entity_registry_enabled_default=False,
)
)
coordinator.load_sensor_data(sensors)
Expand Down

0 comments on commit f800681

Please sign in to comment.