Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonsm committed Feb 6, 2023
1 parent 514b942 commit 1cc4b66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions custom_components/zhibravia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ async def async_setup(hass, config):


async def bravia_get_mac(hass, host, pin):
from homeassistant.components.braviatv.const import CLIENTID_PREFIX, NICKNAME, ATTR_MAC
from homeassistant.components.braviatv.const import LEGACY_CLIENT_ID, NICKNAME_PREFIX, ATTR_MAC
from bravia_tv import BraviaRC
device = BraviaRC(host)
await hass.async_add_executor_job(device.connect, pin, CLIENTID_PREFIX, NICKNAME)
await hass.async_add_executor_job(device.connect, pin, LEGACY_CLIENT_ID, NICKNAME_PREFIX)
if not await hass.async_add_executor_job(device.is_connected):
return None

Expand Down
22 changes: 11 additions & 11 deletions extras/setup/HassFix.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh
# Docker HASS=/usr/src/homeassistant/homeassistant
HASS=/usr/local/lib/python3.10/dist-packages/homeassistant
cd /usr/lib/python3.10/site-packages/homeassistant

sed -i 's/_LOGGER.warning(CUSTOM_WARNING/#LOGGER.warning(CUSTOM_WARNING/' $HASS/loader.py
sed -i 's/minutes=30/days=30/' $HASS/auth/const.py
sed -i 's/ATTERY_MODELS:/ATTERY_MODELS and False:/' $HASS/components/xiaomi_aqara/sensor.py
sed -i 's/await hass.config_entries.async_forward_entry_setups/#wait hass.config_entries.async_forward_entry_setups/' $HASS/components/mobile_app/__init__.py
sed -i 's/_LOGGER.warning(CUSTOM_WARNING/#LOGGER.warning(CUSTOM_WARNING/' loader.py
sed -i 's/minutes=30/days=30/' auth/const.py
sed -i 's/ATTERY_MODELS:/ATTERY_MODELS and False:/' components/xiaomi_aqara/sensor.py
sed -i 's/await hass.config_entries.async_forward_entry_setups/#wait hass.config_entries.async_forward_entry_setups/' components/mobile_app/__init__.py

sed -i 's/Platform.BUTTON/#latform.BUTTON/' $HASS/components/braviatv/__init__.py
sed -i 's/f"{ATTR_MANUFACTURER} {model}"/model/' $HASS/components/braviatv/entity.py
#sed -i 's/await self.coordinator.async_turn_off()/await self.coordinator.async_turn_off(); await self.coordinator.async_turn_off()/' $HASS/components/braviatv/media_player.py
sed -i 's/Platform.BUTTON/#latform.BUTTON/' components/braviatv/__init__.py
sed -i 's/f"{ATTR_MANUFACTURER} {model}"/model/' components/braviatv/entity.py
#sed -i 's/await self.coordinator.async_turn_off()/await self.coordinator.async_turn_off(); await self.coordinator.async_turn_off()/' components/braviatv/media_player.py

#sed -i 's/f"{device.name} Remote"/device.name/' $HASS/components/broadlink/remote.py
#sed -i 's/f"{device.name} Switch"/device.name/' $HASS/components/broadlink/switch.py
sed -i 's/"RM4PRO", "RM4MINI"/"RM4PRO", "RMPRO", "RM4MINI"/' $HASS/components/broadlink/sensor.py
#sed -i 's/f"{device.name} Remote"/device.name/' components/broadlink/remote.py
#sed -i 's/f"{device.name} Switch"/device.name/' components/broadlink/switch.py
sed -i 's/"RM4PRO", "RM4MINI"/"RM4PRO", "RMPRO", "RM4MINI"/' components/broadlink/sensor.py

0 comments on commit 1cc4b66

Please sign in to comment.