mirror of
				https://github.com/home-assistant/core.git
				synced 2025-11-04 00:19:31 +00:00 
			
		
		
		
	Cleanup dispatchers when unloading rfxtrx (#42803)
* Cleanup dispatchers * Fix name * Refactor code * Fix typo in function description * Fix pylint error * Change function definition * Move cleanup_callbacks data to domain
This commit is contained in:
		@@ -20,11 +20,10 @@ from homeassistant.const import (
 | 
			
		||||
from homeassistant.core import callback
 | 
			
		||||
 | 
			
		||||
from . import (
 | 
			
		||||
    CONF_AUTOMATIC_ADD,
 | 
			
		||||
    CONF_DATA_BITS,
 | 
			
		||||
    DATA_TYPES,
 | 
			
		||||
    SIGNAL_EVENT,
 | 
			
		||||
    RfxtrxEntity,
 | 
			
		||||
    connect_auto_add,
 | 
			
		||||
    get_device_id,
 | 
			
		||||
    get_rfx_object,
 | 
			
		||||
)
 | 
			
		||||
@@ -127,8 +126,7 @@ async def async_setup_entry(
 | 
			
		||||
            async_add_entities([entity])
 | 
			
		||||
 | 
			
		||||
    # Subscribe to main RFXtrx events
 | 
			
		||||
    if discovery_info[CONF_AUTOMATIC_ADD]:
 | 
			
		||||
        hass.helpers.dispatcher.async_dispatcher_connect(SIGNAL_EVENT, sensor_update)
 | 
			
		||||
    connect_auto_add(hass, discovery_info, sensor_update)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class RfxtrxSensor(RfxtrxEntity):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user