mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Fix spelling of OctoPrint (#58686)
This commit is contained in:
parent
d1474d8e92
commit
b3e7eeb020
@ -47,7 +47,7 @@ def ensure_valid_path(value):
|
||||
|
||||
|
||||
PLATFORMS = ["binary_sensor", "sensor"]
|
||||
DEFAULT_NAME = "Octoprint"
|
||||
DEFAULT_NAME = "OctoPrint"
|
||||
CONF_NUMBER_OF_TOOLS = "number_of_tools"
|
||||
CONF_BED = "bed"
|
||||
|
||||
|
@ -53,7 +53,7 @@ class OctoPrintBinarySensorBase(CoordinatorEntity, BinarySensorEntity):
|
||||
"""Initialize a new OctoPrint sensor."""
|
||||
super().__init__(coordinator)
|
||||
self._device_id = device_id
|
||||
self._attr_name = f"Octoprint {sensor_type}"
|
||||
self._attr_name = f"OctoPrint {sensor_type}"
|
||||
self._attr_unique_id = f"{sensor_type}-{device_id}"
|
||||
|
||||
@property
|
||||
@ -61,8 +61,8 @@ class OctoPrintBinarySensorBase(CoordinatorEntity, BinarySensorEntity):
|
||||
"""Device info."""
|
||||
return {
|
||||
"identifiers": {(COMPONENT_DOMAIN, self._device_id)},
|
||||
"manufacturer": "Octoprint",
|
||||
"name": "Octoprint",
|
||||
"manufacturer": "OctoPrint",
|
||||
"name": "OctoPrint",
|
||||
}
|
||||
|
||||
@property
|
||||
|
@ -76,7 +76,7 @@ class OctoPrintSensorBase(CoordinatorEntity, SensorEntity):
|
||||
"""Initialize a new OctoPrint sensor."""
|
||||
super().__init__(coordinator)
|
||||
self._device_id = device_id
|
||||
self._attr_name = f"Octoprint {sensor_type}"
|
||||
self._attr_name = f"OctoPrint {sensor_type}"
|
||||
self._attr_unique_id = f"{sensor_type}-{device_id}"
|
||||
|
||||
@property
|
||||
@ -84,8 +84,8 @@ class OctoPrintSensorBase(CoordinatorEntity, SensorEntity):
|
||||
"""Device info."""
|
||||
return {
|
||||
"identifiers": {(COMPONENT_DOMAIN, self._device_id)},
|
||||
"manufacturer": "Octoprint",
|
||||
"name": "Octoprint",
|
||||
"manufacturer": "OctoPrint",
|
||||
"name": "OctoPrint",
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,12 +67,12 @@ async def init_integration(
|
||||
data={
|
||||
"host": "1.1.1.1",
|
||||
"api_key": "test-key",
|
||||
"name": "Octoprint",
|
||||
"name": "OctoPrint",
|
||||
"port": 81,
|
||||
"ssl": True,
|
||||
"path": "/",
|
||||
},
|
||||
title="Octoprint",
|
||||
title="OctoPrint",
|
||||
)
|
||||
config_entry.add_to_hass(hass)
|
||||
|
||||
|
@ -21,14 +21,14 @@ async def test_sensors(hass):
|
||||
state = hass.states.get("binary_sensor.octoprint_printing")
|
||||
assert state is not None
|
||||
assert state.state == STATE_ON
|
||||
assert state.name == "Octoprint Printing"
|
||||
assert state.name == "OctoPrint Printing"
|
||||
entry = entity_registry.async_get("binary_sensor.octoprint_printing")
|
||||
assert entry.unique_id == "Printing-uuid"
|
||||
|
||||
state = hass.states.get("binary_sensor.octoprint_printing_error")
|
||||
assert state is not None
|
||||
assert state.state == STATE_OFF
|
||||
assert state.name == "Octoprint Printing Error"
|
||||
assert state.name == "OctoPrint Printing Error"
|
||||
entry = entity_registry.async_get("binary_sensor.octoprint_printing_error")
|
||||
assert entry.unique_id == "Printing Error-uuid"
|
||||
|
||||
@ -42,13 +42,13 @@ async def test_sensors_printer_offline(hass):
|
||||
state = hass.states.get("binary_sensor.octoprint_printing")
|
||||
assert state is not None
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
assert state.name == "Octoprint Printing"
|
||||
assert state.name == "OctoPrint Printing"
|
||||
entry = entity_registry.async_get("binary_sensor.octoprint_printing")
|
||||
assert entry.unique_id == "Printing-uuid"
|
||||
|
||||
state = hass.states.get("binary_sensor.octoprint_printing_error")
|
||||
assert state is not None
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
assert state.name == "Octoprint Printing Error"
|
||||
assert state.name == "OctoPrint Printing Error"
|
||||
entry = entity_registry.async_get("binary_sensor.octoprint_printing_error")
|
||||
assert entry.unique_id == "Printing Error-uuid"
|
||||
|
@ -29,48 +29,48 @@ async def test_sensors(hass):
|
||||
state = hass.states.get("sensor.octoprint_job_percentage")
|
||||
assert state is not None
|
||||
assert state.state == "50"
|
||||
assert state.name == "Octoprint Job Percentage"
|
||||
assert state.name == "OctoPrint Job Percentage"
|
||||
entry = entity_registry.async_get("sensor.octoprint_job_percentage")
|
||||
assert entry.unique_id == "Job Percentage-uuid"
|
||||
|
||||
state = hass.states.get("sensor.octoprint_current_state")
|
||||
assert state is not None
|
||||
assert state.state == "Operational"
|
||||
assert state.name == "Octoprint Current State"
|
||||
assert state.name == "OctoPrint Current State"
|
||||
entry = entity_registry.async_get("sensor.octoprint_current_state")
|
||||
assert entry.unique_id == "Current State-uuid"
|
||||
|
||||
state = hass.states.get("sensor.octoprint_actual_tool1_temp")
|
||||
assert state is not None
|
||||
assert state.state == "18.83"
|
||||
assert state.name == "Octoprint actual tool1 temp"
|
||||
assert state.name == "OctoPrint actual tool1 temp"
|
||||
entry = entity_registry.async_get("sensor.octoprint_actual_tool1_temp")
|
||||
assert entry.unique_id == "actual tool1 temp-uuid"
|
||||
|
||||
state = hass.states.get("sensor.octoprint_target_tool1_temp")
|
||||
assert state is not None
|
||||
assert state.state == "37.83"
|
||||
assert state.name == "Octoprint target tool1 temp"
|
||||
assert state.name == "OctoPrint target tool1 temp"
|
||||
entry = entity_registry.async_get("sensor.octoprint_target_tool1_temp")
|
||||
assert entry.unique_id == "target tool1 temp-uuid"
|
||||
|
||||
state = hass.states.get("sensor.octoprint_target_tool1_temp")
|
||||
assert state is not None
|
||||
assert state.state == "37.83"
|
||||
assert state.name == "Octoprint target tool1 temp"
|
||||
assert state.name == "OctoPrint target tool1 temp"
|
||||
entry = entity_registry.async_get("sensor.octoprint_target_tool1_temp")
|
||||
assert entry.unique_id == "target tool1 temp-uuid"
|
||||
|
||||
state = hass.states.get("sensor.octoprint_start_time")
|
||||
assert state is not None
|
||||
assert state.state == "2020-02-20T09:00:00"
|
||||
assert state.name == "Octoprint Start Time"
|
||||
assert state.name == "OctoPrint Start Time"
|
||||
entry = entity_registry.async_get("sensor.octoprint_start_time")
|
||||
assert entry.unique_id == "Start Time-uuid"
|
||||
|
||||
state = hass.states.get("sensor.octoprint_estimated_finish_time")
|
||||
assert state is not None
|
||||
assert state.state == "2020-02-20T10:50:00"
|
||||
assert state.name == "Octoprint Estimated Finish Time"
|
||||
assert state.name == "OctoPrint Estimated Finish Time"
|
||||
entry = entity_registry.async_get("sensor.octoprint_estimated_finish_time")
|
||||
assert entry.unique_id == "Estimated Finish Time-uuid"
|
||||
|
Loading…
x
Reference in New Issue
Block a user