Skip to content

Commit

Permalink
chore: cleanup code and lint type
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleglaunec committed Nov 15, 2024
1 parent 3cf6b64 commit 36ca0f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 75 deletions.
4 changes: 2 additions & 2 deletions custom_components/linkytic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry):
else:
new[SETUP_SERIAL] = serial_by_id

#config_entry.minor_version = 2
hass.config_entries.async_update_entry(config_entry, data=new, minor_version=2)
# config_entry.minor_version = 2
hass.config_entries.async_update_entry(config_entry, data=new, minor_version=2, version=1) # type: ignore

_LOGGER.info(
"Migration to version %d.%d successful",
Expand Down
72 changes: 0 additions & 72 deletions custom_components/linkytic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,6 @@ async def async_setup_entry(
serial_reader=serial_reader,
icon="mdi:list-status",
),
# LinkyTICStatusRegisterSensor(
# name="Statut contact sec",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:electric-switch",
# field=StatusRegister.CONTACT_SEC,
# ),
LinkyTICStatusRegisterSensor(
name="Statut organe de coupure",
config_title=config_entry.title,
Expand All @@ -430,46 +422,6 @@ async def async_setup_entry(
icon="mdi:connection",
field=StatusRegister.ORGANE_DE_COUPURE,
),
# LinkyTICStatusRegisterSensor(
# name="Statut état du cache-bornes distributeur",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:toy-brick-outline",
# field=StatusRegister.ETAT_DU_CACHE_BORNE_DISTRIBUTEUR,
# ),
# LinkyTICStatusRegisterSensor(
# name="Statut surtension sur une des phases",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:flash-alert",
# field=StatusRegister.SURTENSION_SUR_UNE_DES_PHASES,
# ),
# LinkyTICStatusRegisterSensor(
# name="Statut dépassement de la puissance de référence",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:flash-alert",
# field=StatusRegister.DEPASSEMENT_PUISSANCE_REFERENCE,
# ),
# LinkyTICStatusRegisterSensor(
# name="Statut producteur/consommateur",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:transmission-tower",
# field=StatusRegister.PRODUCTEUR_CONSOMMATEUR,
# ),
# LinkyTICStatusRegisterSensor(
# name="Statut sens de l’énergie active",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:transmission-tower",
# field=StatusRegister.SENS_ENERGIE_ACTIVE,
# ),
LinkyTICStatusRegisterSensor(
name="Statut tarif contrat fourniture",
config_title=config_entry.title,
Expand All @@ -486,22 +438,6 @@ async def async_setup_entry(
icon="mdi:cash-check",
field=StatusRegister.TARIF_CONTRAT_DISTRIBUTEUR,
),
# LinkyTICStatusRegisterSensor(
# name="Statut mode dégradée de l'horloge",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:clock-alert-outline",
# field=StatusRegister.MODE_DEGRADE_HORLOGE,
# ),
# LinkyTICStatusRegisterSensor(
# name="Statut sortie télé-information",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:tag",
# field=StatusRegister.MODE_TIC,
# ),
LinkyTICStatusRegisterSensor(
name="Statut sortie communication Euridis",
config_title=config_entry.title,
Expand All @@ -518,14 +454,6 @@ async def async_setup_entry(
icon="mdi:tag",
field=StatusRegister.STATUS_CPL,
),
# LinkyTICStatusRegisterSensor(
# name="Statut synchronisation CPL",
# config_title=config_entry.title,
# config_uniq_id=config_entry.entry_id,
# serial_reader=serial_reader,
# icon="mdi:sync",
# field=StatusRegister.SYNCHRO_CPL,
# ),
LinkyTICStatusRegisterSensor(
name="Statut couleur du jour tempo",
config_title=config_entry.title,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/linkytic/status_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_status(self, register: str) -> str | bool:
}


class StatusRegister(StatusRegisterEnumValueType, Enum):
class StatusRegister(Enum):
"""Field provided by status register.
The value corresponds to the (position, bits).
"""
Expand Down

0 comments on commit 36ca0f0

Please sign in to comment.