Skip to content

Commit

Permalink
➕➖ HACS files
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 31, 2024
1 parent 0dfb697 commit 566edb2
Show file tree
Hide file tree
Showing 1,261 changed files with 39,816 additions and 6,320 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
193 changes: 192 additions & 1 deletion custom_components/battery_notes/data/library.json

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion custom_components/elkbledom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ async def _async_stop(event: Event) -> None:
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop)
)

return True

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
Expand Down
Binary file not shown.
Binary file modified custom_components/elkbledom/__pycache__/__init__.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified custom_components/elkbledom/__pycache__/const.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file modified custom_components/elkbledom/__pycache__/elkbledom.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file modified custom_components/elkbledom/__pycache__/light.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file modified custom_components/elkbledom/__pycache__/number.cpython-313.pyc
Binary file not shown.
44 changes: 18 additions & 26 deletions custom_components/elkbledom/elkbledom.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
from datetime import datetime
from homeassistant.components import bluetooth
from homeassistant.exceptions import ConfigEntryNotReady

from bleak.backends.device import BLEDevice
Expand Down Expand Up @@ -67,25 +66,31 @@
NAME_ARRAY = ["ELK-BLE",
"LEDBLE",
"MELK",
"ELK-BULB"]
"ELK-BULB",
"ELK-LAMPL"]
WRITE_CHARACTERISTIC_UUIDS = ["0000fff3-0000-1000-8000-00805f9b34fb",
"0000ffe1-0000-1000-8000-00805f9b34fb",
"0000fff3-0000-1000-8000-00805f9b34fb",
"0000fff3-0000-1000-8000-00805f9b34fb",
"0000fff3-0000-1000-8000-00805f9b34fb"]
READ_CHARACTERISTIC_UUIDS = ["0000fff4-0000-1000-8000-00805f9b34fb",
"0000ffe2-0000-1000-8000-00805f9b34fb",
"0000fff4-0000-1000-8000-00805f9b34fb",
"0000fff4-0000-1000-8000-00805f9b34fb",
"0000fff4-0000-1000-8000-00805f9b34fb"]
TURN_ON_CMD = [[0x7e, 0x00, 0x04, 0xf0, 0x00, 0x01, 0xff, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0xef]]
TURN_OFF_CMD = [[0x7e, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xef],
[0x7e, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xef]]
MIN_COLOR_TEMPS_K = [2700,2700,2700,2700]
MAX_COLOR_TEMPS_K = [6500,6500,6500,6500]

MIN_COLOR_TEMPS_K = [2700,2700,2700,2700,2700]
MAX_COLOR_TEMPS_K = [6500,6500,6500,6500,6500]

DEFAULT_ATTEMPTS = 3
#DISCONNECT_DELAY = 120
Expand Down Expand Up @@ -132,7 +137,7 @@ async def _async_wrap_retry_bluetooth_connection_error(
class DeviceData():
def __init__(self, hass, discovery_info):
self._discovery = discovery_info
self._supported = self._discovery.name.lower().startswith("elk-ble") or self._discovery.name.lower().startswith("elk-bulb") or self._discovery.name.lower().startswith("ledble") or self._discovery.name.lower().startswith("melk")
self._supported = any(self._discovery.name.lower().startswith(option.lower()) for option in NAME_ARRAY)
self._address = self._discovery.address
self._name = self._discovery.name
self._rssi = self._discovery.rssi
Expand All @@ -150,20 +155,6 @@ def __init__(self, hass, discovery_info):
# if not self._bledevice:
# raise ConfigEntryNotReady(f"You need to add bluetooth integration (https://www.home-assistant.io/integrations/bluetooth) or couldn't find a nearby device with address: {address}")


# def __init__(self, *args):
# if isinstance(args[0], BluetoothServiceInfoBleak):
# self._discovery = args[0]
# self._supported = self._discovery.name.lower().startswith("elk-ble") or self._discovery.name.lower().startswith("elk-bulb") or self._discovery.name.lower().startswith("ledble") or self._discovery.name.lower().startswith("melk")
# self.address = self._discovery.address
# self.name = self._discovery.name
# self.rssi = self._discovery.rssi
# else:
# self._supported = args[0]
# self.address = args[1]
# self.name = args[2]
# self.rssi = args[3]

@property
def is_supported(self) -> bool:
return self._supported
Expand Down Expand Up @@ -475,9 +466,12 @@ async def _ensure_connected(self) -> None:
#login commands
await self._login_command()

if not self._device.name.lower().startswith("melk"):
LOGGER.debug("%s: Subscribe to notifications; RSSI: %s", self.name, self.rssi)
await client.start_notify(self._read_uuid, self._notification_handler)
try:
if not self._device.name.lower().startswith("melk") and not self._device.name.lower().startswith("ledble"):
LOGGER.debug("%s: Subscribe to notifications; RSSI: %s", self.name, self.rssi)
await client.start_notify(self._read_uuid, self._notification_handler)
except Exception as e:
LOGGER.error("Error during connection: %s", e)

async def _login_command(self):
try:
Expand Down Expand Up @@ -564,8 +558,6 @@ async def _execute_timed_disconnect(self) -> None:
self._delay,
)
await self._execute_disconnect()


async def _execute_disconnect(self) -> None:
"""Execute disconnection."""
async with self._connect_lock:
Expand All @@ -578,8 +570,8 @@ async def _execute_disconnect(self) -> None:
self._read_uuid = None
if client and client.is_connected:
try:
if not self._device.name.lower().startswith("melk"):
if not self._device.name.lower().startswith("melk") and not self._device.name.lower().startswith("ledble"):
await client.stop_notify(read_char)
await client.disconnect()
except Exception as e:
LOGGER.error("Error during disconnection: %s", e)
LOGGER.error("Error during disconnection: %s", e)
2 changes: 1 addition & 1 deletion custom_components/elkbledom/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .const import DOMAIN, EFFECTS, EFFECTS_list

from homeassistant.const import CONF_MAC
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.components.light import (
PLATFORM_SCHEMA,
Expand Down
7 changes: 4 additions & 3 deletions custom_components/elkbledom/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
{ "local_name": "ELK-BULB*" },
{ "local_name": "ELK-BLE*" },
{ "local_name": "MELK*" },
{ "local_name": "LEDBLE*" }
{ "local_name": "LEDBLE*" },
{ "local_name": "ELK-LAMPL*" }
],
"codeowners": ["@dave-code-ruiz"],
"config_flow": true,
"dependencies": ["bluetooth"],
"documentation": "https://github.com/dave-code-ruiz/elkbledom",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/dave-code-ruiz/elkbledom/issues",
"requirements": ["bleak-retry-connector>=1.17.1","bleak>=0.17.0"],
"version": "1.0.2"
"requirements": ["bleak-retry-connector>=3.5.0","bleak>=0.22.2"],
"version": "1.2.2"
}
4 changes: 3 additions & 1 deletion custom_components/elkbledom/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
},
"abort": {
"cannot_validate": "Unable to validate Elkbledom light",
"cannot_connect": "Unable to connect to Elkbledom"
"cannot_connect": "Unable to connect to Elkbledom",
"not_supported": "Elkbledom light not supported",
"invalid_discovery_info": "Invalid discovery info in bluetooth device"
}
},
"options": {
Expand Down
4 changes: 3 additions & 1 deletion custom_components/elkbledom/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
},
"abort": {
"cannot_validate": "No se puede validar la conexión",
"cannot_connect": "No se puede conectar con la tira led"
"cannot_connect": "No se puede conectar con la tira led",
"not_supported": "Tira led no soportada",
"invalid_discovery_info": "No se encuentra información de la tira led"
}
},
"options": {
Expand Down
4 changes: 3 additions & 1 deletion custom_components/elkbledom/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
},
"abort": {
"cannot_validate": "Echec de validation de la lumi?re Elkbledom",
"cannot_connect": "Echec de la connexion ? Elkbledom"
"cannot_connect": "Echec de la connexion ? Elkbledom",
"not_supported": "La lumi?re ElkBledom n'est pas prise en charge",
"invalid_discovery_info": "Informations de d?couverte non valides sur le p?riph?rique Bluetooth"
}
},
"options": {
Expand Down
4 changes: 3 additions & 1 deletion custom_components/elkbledom/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
},
"abort": {
"cannot_validate": "Nie można zweryfikować światła Elkbledom",
"cannot_connect": "Nie można połączyć się ze światłem Elkbledom"
"cannot_connect": "Nie można połączyć się ze światłem Elkbledom",
"not_supported": "wiato ElkBledom nie jest obsugiwane",
"invalid_discovery_info": "Nieprawidowe informacje o odkryciu w urzdzeniu Bluetooth"
}
},
"options": {
Expand Down
4 changes: 3 additions & 1 deletion custom_components/elkbledom/translations/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
},
"abort": {
"cannot_validate": "Nie je možné overiť Elkbledom light",
"cannot_connect": "Nedá sa pripojiť k Elbledom"
"cannot_connect": "Nedá sa pripojiť k Elbledom",
"not_supported": "Svetlo Elk Bledom nie je podporovane",
"invalid_discovery_info": "Neplatne informacie o objaveni v zariadeni bluetooth"
}
},
"options": {
Expand Down
4 changes: 3 additions & 1 deletion custom_components/elkbledom/translations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
},
"abort": {
"cannot_validate": "Elkbledom ışığı doğrulanamıyor",
"cannot_connect": "Elkbledom'a bağlanılamıyor"
"cannot_connect": "Elkbledom'a bağlanılamıyor",
"not_supported": "ElkBledom ???? desteklenmiyor",
"invalid_discovery_info": "Bluetooth aygtnda geersiz keif bilgisi"
}
},
"options": {
Expand Down
179 changes: 0 additions & 179 deletions custom_components/ember_mug/__init__.py

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 566edb2

Please sign in to comment.