Rename create_api_object to be private (#90187)

This commit is contained in:
Nalin Mahajan 2023-03-24 02:44:35 -05:00 committed by GitHub
parent 1224b1aff6
commit 34324c98de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -175,7 +175,7 @@ class Control4Light(Control4Entity, LightEntity):
self._attr_color_mode = ColorMode.ONOFF
self._attr_supported_color_modes = {ColorMode.ONOFF}
def create_api_object(self):
def _create_api_object(self):
"""Create a pyControl4 device object.
This exists so the director token used is always the latest one, without needing to re-init the entire entity.
@ -203,7 +203,7 @@ class Control4Light(Control4Entity, LightEntity):
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the entity on."""
c4_light = self.create_api_object()
c4_light = self._create_api_object()
if self._is_dimmer:
if ATTR_TRANSITION in kwargs:
transition_length = kwargs[ATTR_TRANSITION] * 1000
@ -226,7 +226,7 @@ class Control4Light(Control4Entity, LightEntity):
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the entity off."""
c4_light = self.create_api_object()
c4_light = self._create_api_object()
if self._is_dimmer:
if ATTR_TRANSITION in kwargs:
transition_length = kwargs[ATTR_TRANSITION] * 1000