Fix spelling of OctoPrint (#58686)

This commit is contained in:
Franck Nijhof 2021-10-29 13:21:57 +02:00 committed by GitHub
parent d1474d8e92
commit b3e7eeb020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 20 deletions

View file

@ -47,7 +47,7 @@ def ensure_valid_path(value):
PLATFORMS = ["binary_sensor", "sensor"] PLATFORMS = ["binary_sensor", "sensor"]
DEFAULT_NAME = "Octoprint" DEFAULT_NAME = "OctoPrint"
CONF_NUMBER_OF_TOOLS = "number_of_tools" CONF_NUMBER_OF_TOOLS = "number_of_tools"
CONF_BED = "bed" CONF_BED = "bed"

View file

@ -53,7 +53,7 @@ class OctoPrintBinarySensorBase(CoordinatorEntity, BinarySensorEntity):
"""Initialize a new OctoPrint sensor.""" """Initialize a new OctoPrint sensor."""
super().__init__(coordinator) super().__init__(coordinator)
self._device_id = device_id 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}" self._attr_unique_id = f"{sensor_type}-{device_id}"
@property @property
@ -61,8 +61,8 @@ class OctoPrintBinarySensorBase(CoordinatorEntity, BinarySensorEntity):
"""Device info.""" """Device info."""
return { return {
"identifiers": {(COMPONENT_DOMAIN, self._device_id)}, "identifiers": {(COMPONENT_DOMAIN, self._device_id)},
"manufacturer": "Octoprint", "manufacturer": "OctoPrint",
"name": "Octoprint", "name": "OctoPrint",
} }
@property @property

View file

@ -76,7 +76,7 @@ class OctoPrintSensorBase(CoordinatorEntity, SensorEntity):
"""Initialize a new OctoPrint sensor.""" """Initialize a new OctoPrint sensor."""
super().__init__(coordinator) super().__init__(coordinator)
self._device_id = device_id 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}" self._attr_unique_id = f"{sensor_type}-{device_id}"
@property @property
@ -84,8 +84,8 @@ class OctoPrintSensorBase(CoordinatorEntity, SensorEntity):
"""Device info.""" """Device info."""
return { return {
"identifiers": {(COMPONENT_DOMAIN, self._device_id)}, "identifiers": {(COMPONENT_DOMAIN, self._device_id)},
"manufacturer": "Octoprint", "manufacturer": "OctoPrint",
"name": "Octoprint", "name": "OctoPrint",
} }

View file

@ -67,12 +67,12 @@ async def init_integration(
data={ data={
"host": "1.1.1.1", "host": "1.1.1.1",
"api_key": "test-key", "api_key": "test-key",
"name": "Octoprint", "name": "OctoPrint",
"port": 81, "port": 81,
"ssl": True, "ssl": True,
"path": "/", "path": "/",
}, },
title="Octoprint", title="OctoPrint",
) )
config_entry.add_to_hass(hass) config_entry.add_to_hass(hass)

View file

@ -21,14 +21,14 @@ async def test_sensors(hass):
state = hass.states.get("binary_sensor.octoprint_printing") state = hass.states.get("binary_sensor.octoprint_printing")
assert state is not None assert state is not None
assert state.state == STATE_ON assert state.state == STATE_ON
assert state.name == "Octoprint Printing" assert state.name == "OctoPrint Printing"
entry = entity_registry.async_get("binary_sensor.octoprint_printing") entry = entity_registry.async_get("binary_sensor.octoprint_printing")
assert entry.unique_id == "Printing-uuid" assert entry.unique_id == "Printing-uuid"
state = hass.states.get("binary_sensor.octoprint_printing_error") state = hass.states.get("binary_sensor.octoprint_printing_error")
assert state is not None assert state is not None
assert state.state == STATE_OFF 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") entry = entity_registry.async_get("binary_sensor.octoprint_printing_error")
assert entry.unique_id == "Printing Error-uuid" 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") state = hass.states.get("binary_sensor.octoprint_printing")
assert state is not None assert state is not None
assert state.state == STATE_UNAVAILABLE assert state.state == STATE_UNAVAILABLE
assert state.name == "Octoprint Printing" assert state.name == "OctoPrint Printing"
entry = entity_registry.async_get("binary_sensor.octoprint_printing") entry = entity_registry.async_get("binary_sensor.octoprint_printing")
assert entry.unique_id == "Printing-uuid" assert entry.unique_id == "Printing-uuid"
state = hass.states.get("binary_sensor.octoprint_printing_error") state = hass.states.get("binary_sensor.octoprint_printing_error")
assert state is not None assert state is not None
assert state.state == STATE_UNAVAILABLE 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") entry = entity_registry.async_get("binary_sensor.octoprint_printing_error")
assert entry.unique_id == "Printing Error-uuid" assert entry.unique_id == "Printing Error-uuid"

View file

@ -29,48 +29,48 @@ async def test_sensors(hass):
state = hass.states.get("sensor.octoprint_job_percentage") state = hass.states.get("sensor.octoprint_job_percentage")
assert state is not None assert state is not None
assert state.state == "50" 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") entry = entity_registry.async_get("sensor.octoprint_job_percentage")
assert entry.unique_id == "Job Percentage-uuid" assert entry.unique_id == "Job Percentage-uuid"
state = hass.states.get("sensor.octoprint_current_state") state = hass.states.get("sensor.octoprint_current_state")
assert state is not None assert state is not None
assert state.state == "Operational" 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") entry = entity_registry.async_get("sensor.octoprint_current_state")
assert entry.unique_id == "Current State-uuid" assert entry.unique_id == "Current State-uuid"
state = hass.states.get("sensor.octoprint_actual_tool1_temp") state = hass.states.get("sensor.octoprint_actual_tool1_temp")
assert state is not None assert state is not None
assert state.state == "18.83" 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") entry = entity_registry.async_get("sensor.octoprint_actual_tool1_temp")
assert entry.unique_id == "actual tool1 temp-uuid" assert entry.unique_id == "actual tool1 temp-uuid"
state = hass.states.get("sensor.octoprint_target_tool1_temp") state = hass.states.get("sensor.octoprint_target_tool1_temp")
assert state is not None assert state is not None
assert state.state == "37.83" 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") entry = entity_registry.async_get("sensor.octoprint_target_tool1_temp")
assert entry.unique_id == "target tool1 temp-uuid" assert entry.unique_id == "target tool1 temp-uuid"
state = hass.states.get("sensor.octoprint_target_tool1_temp") state = hass.states.get("sensor.octoprint_target_tool1_temp")
assert state is not None assert state is not None
assert state.state == "37.83" 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") entry = entity_registry.async_get("sensor.octoprint_target_tool1_temp")
assert entry.unique_id == "target tool1 temp-uuid" assert entry.unique_id == "target tool1 temp-uuid"
state = hass.states.get("sensor.octoprint_start_time") state = hass.states.get("sensor.octoprint_start_time")
assert state is not None assert state is not None
assert state.state == "2020-02-20T09:00:00" 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") entry = entity_registry.async_get("sensor.octoprint_start_time")
assert entry.unique_id == "Start Time-uuid" assert entry.unique_id == "Start Time-uuid"
state = hass.states.get("sensor.octoprint_estimated_finish_time") state = hass.states.get("sensor.octoprint_estimated_finish_time")
assert state is not None assert state is not None
assert state.state == "2020-02-20T10:50:00" 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") entry = entity_registry.async_get("sensor.octoprint_estimated_finish_time")
assert entry.unique_id == "Estimated Finish Time-uuid" assert entry.unique_id == "Estimated Finish Time-uuid"