mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Add Freebox button to mark calls as read (#80609)
* Add Freebox button to mark calls as read * Bump Freebox to 1.0.1 * Fix black/flake8 * Add entity_category + fix reboot button name * Add has_entity_name to reboot * Remove 'missed' as it put all calls as read * base unique_id on key and not name * unique_id base on key later with migration step * Keep the same name Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
91e6ee5da5
commit
b1202ab31f
@ -11,7 +11,7 @@ from homeassistant.components.button import (
|
|||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
@ -37,8 +37,15 @@ BUTTON_DESCRIPTIONS: tuple[FreeboxButtonEntityDescription, ...] = (
|
|||||||
key="reboot",
|
key="reboot",
|
||||||
name="Reboot Freebox",
|
name="Reboot Freebox",
|
||||||
device_class=ButtonDeviceClass.RESTART,
|
device_class=ButtonDeviceClass.RESTART,
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
async_press=lambda router: router.reboot(),
|
async_press=lambda router: router.reboot(),
|
||||||
),
|
),
|
||||||
|
FreeboxButtonEntityDescription(
|
||||||
|
key="mark_calls_as_read",
|
||||||
|
name="Mark calls as read",
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
async_press=lambda router: router.call.mark_calls_log_as_read(),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Freebox",
|
"name": "Freebox",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/freebox",
|
"documentation": "https://www.home-assistant.io/integrations/freebox",
|
||||||
"requirements": ["freebox-api==1.0.0"],
|
"requirements": ["freebox-api==1.0.1"],
|
||||||
"zeroconf": ["_fbx-api._tcp.local."],
|
"zeroconf": ["_fbx-api._tcp.local."],
|
||||||
"codeowners": ["@hacf-fr", "@Quentame"],
|
"codeowners": ["@hacf-fr", "@Quentame"],
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
|
@ -9,6 +9,7 @@ from pathlib import Path
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from freebox_api import Freepybox
|
from freebox_api import Freepybox
|
||||||
|
from freebox_api.api.call import Call
|
||||||
from freebox_api.api.wifi import Wifi
|
from freebox_api.api.wifi import Wifi
|
||||||
from freebox_api.exceptions import NotOpenError
|
from freebox_api.exceptions import NotOpenError
|
||||||
|
|
||||||
@ -186,6 +187,11 @@ class FreeboxRouter:
|
|||||||
"""Return sensors."""
|
"""Return sensors."""
|
||||||
return {**self.sensors_temperature, **self.sensors_connection}
|
return {**self.sensors_temperature, **self.sensors_connection}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def call(self) -> Call:
|
||||||
|
"""Return the call."""
|
||||||
|
return self._api.call
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def wifi(self) -> Wifi:
|
def wifi(self) -> Wifi:
|
||||||
"""Return the wifi."""
|
"""Return the wifi."""
|
||||||
|
@ -709,7 +709,7 @@ forecast_solar==2.2.0
|
|||||||
fortiosapi==1.0.5
|
fortiosapi==1.0.5
|
||||||
|
|
||||||
# homeassistant.components.freebox
|
# homeassistant.components.freebox
|
||||||
freebox-api==1.0.0
|
freebox-api==1.0.1
|
||||||
|
|
||||||
# homeassistant.components.free_mobile
|
# homeassistant.components.free_mobile
|
||||||
freesms==0.2.0
|
freesms==0.2.0
|
||||||
|
@ -528,7 +528,7 @@ foobot_async==1.0.0
|
|||||||
forecast_solar==2.2.0
|
forecast_solar==2.2.0
|
||||||
|
|
||||||
# homeassistant.components.freebox
|
# homeassistant.components.freebox
|
||||||
freebox-api==1.0.0
|
freebox-api==1.0.1
|
||||||
|
|
||||||
# homeassistant.components.fritz
|
# homeassistant.components.fritz
|
||||||
# homeassistant.components.fritzbox_callmonitor
|
# homeassistant.components.fritzbox_callmonitor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user