feat(hass): add android tv remote card
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
6fd7f5ed48
commit
d481c4be32
7 changed files with 208 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
enable = true;
|
||||
|
||||
extraComponents = [
|
||||
"androidtv"
|
||||
"androidtv_remote"
|
||||
"caldav"
|
||||
"cast"
|
||||
|
@ -30,6 +31,13 @@
|
|||
"yamaha_musiccast"
|
||||
];
|
||||
|
||||
customComponents = builtins.attrValues {
|
||||
inherit
|
||||
(self.legacyPackages.${pkgs.system}.hass-components)
|
||||
yamaha-soundbar
|
||||
;
|
||||
};
|
||||
|
||||
config = {
|
||||
homeassistant = {
|
||||
name = "Home";
|
||||
|
@ -40,6 +48,17 @@
|
|||
external_url = "https://homie.nelim.org";
|
||||
};
|
||||
|
||||
media_player = [
|
||||
{
|
||||
platform = "yamaha_soundbar";
|
||||
host = "192.168.0.96";
|
||||
name = "Living Room Speaker";
|
||||
sources = {
|
||||
HDMI = "TV";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# Proxy settings
|
||||
http = {
|
||||
server_host = "0.0.0.0";
|
||||
|
|
|
@ -90,6 +90,7 @@ in {
|
|||
inherit
|
||||
(pkgs.home-assistant-custom-lovelace-modules)
|
||||
card-mod
|
||||
universal-remote-card
|
||||
;
|
||||
|
||||
inherit
|
||||
|
@ -140,6 +141,166 @@ in {
|
|||
"timer.assist_timer3"
|
||||
];
|
||||
}
|
||||
|
||||
{
|
||||
type = "custom:android-tv-card";
|
||||
|
||||
media_player_id = "media_player.living_room_speaker";
|
||||
keyboard_id = "remote.android_tv_192_168_0_106";
|
||||
remote_id = "remote.onn_4k_streaming_box";
|
||||
|
||||
rows = [
|
||||
"navigation_buttons"
|
||||
[null "slider" null]
|
||||
[null]
|
||||
["jellyfin" "home" "back" "keyboard"]
|
||||
[null]
|
||||
];
|
||||
|
||||
custom_actions = [
|
||||
{
|
||||
name = "center";
|
||||
type = "button";
|
||||
icon = "mdi:checkbox-blank-circle";
|
||||
|
||||
styles = ''
|
||||
:host {
|
||||
--icon-color: rgb(94, 94, 94);
|
||||
--size: 200px;
|
||||
background: rgb(31, 31, 31);
|
||||
border-radius: 200px;
|
||||
margin: -70px;
|
||||
padding: 70px;
|
||||
}
|
||||
'';
|
||||
|
||||
tap_action = {
|
||||
action = "key";
|
||||
key = "DPAD_CENTER";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "up";
|
||||
type = "button";
|
||||
icon = "mdi:chevron-up";
|
||||
|
||||
styles = ''
|
||||
:host {
|
||||
--icon-color: rgb(197, 199, 197);
|
||||
z-index: 2;
|
||||
top: 25px;
|
||||
height: 90px;
|
||||
width: 300px;
|
||||
}
|
||||
'';
|
||||
|
||||
hold_action = {action = "repeat";};
|
||||
tap_action = {
|
||||
action = "key";
|
||||
key = "DPAD_UP";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "down";
|
||||
type = "button";
|
||||
icon = "mdi:chevron-down";
|
||||
|
||||
styles = ''
|
||||
:host {
|
||||
--icon-color: rgb(197, 199, 197);
|
||||
z-index: 2;
|
||||
bottom: 25px;
|
||||
height: 90px;
|
||||
width: 300px;
|
||||
}
|
||||
'';
|
||||
|
||||
hold_action = {action = "repeat";};
|
||||
tap_action = {
|
||||
action = "key";
|
||||
key = "DPAD_DOWN";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "left";
|
||||
type = "button";
|
||||
icon = "mdi:chevron-left";
|
||||
|
||||
styles = ''
|
||||
:host {
|
||||
--icon-color: rgb(197, 199, 197);
|
||||
z-index: 2;
|
||||
left: 30px;
|
||||
height: 170px;
|
||||
width: 90px;
|
||||
}
|
||||
'';
|
||||
|
||||
hold_action = {action = "repeat";};
|
||||
tap_action = {
|
||||
action = "key";
|
||||
key = "DPAD_LEFT";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "right";
|
||||
type = "button";
|
||||
icon = "mdi:chevron-right";
|
||||
|
||||
styles = ''
|
||||
:host {
|
||||
--icon-color: rgb(197, 199, 197);
|
||||
z-index: 2;
|
||||
right: 30px;
|
||||
height: 170px;
|
||||
width: 90px;
|
||||
}
|
||||
'';
|
||||
|
||||
hold_action = {action = "repeat";};
|
||||
tap_action = {
|
||||
action = "key";
|
||||
key = "DPAD_RIGHT";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "slider";
|
||||
type = "slider";
|
||||
icon = "mdi:volume-high";
|
||||
|
||||
range = [0 1];
|
||||
step = 0.01;
|
||||
|
||||
tap_action = {
|
||||
action = "perform-action";
|
||||
perform_action = "media_player.volume_set";
|
||||
data = {
|
||||
volume_level = "{{ value | float }}";
|
||||
};
|
||||
};
|
||||
value_attribute = "volume_level";
|
||||
}
|
||||
];
|
||||
|
||||
styles = ''
|
||||
#row-1 {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#row-2 {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#row-3 {
|
||||
justify-content: center;
|
||||
}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
|
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
BIN
flake.nix
BIN
flake.nix
Binary file not shown.
|
@ -202,6 +202,11 @@ let
|
|||
owner = "net-daemon";
|
||||
repo = "integration";
|
||||
}
|
||||
{
|
||||
owner = "osk2";
|
||||
repo = "yamaha-soundbar";
|
||||
}
|
||||
|
||||
### SpotifyPlus
|
||||
{
|
||||
name = "spotifyplus-src";
|
||||
|
|
|
@ -13,4 +13,5 @@ in {
|
|||
netdaemon = buildHassComponent ./netdaemon {};
|
||||
spotifyplus = import ./spotifyplus ({inherit buildHassComponent;} // inputs);
|
||||
tuya-local = buildHassComponent ./tuya-local {};
|
||||
yamaha-soundbar = buildHassComponent ./yamaha-soundbar {};
|
||||
})
|
||||
|
|
22
legacyPackages/hass-components/yamaha-soundbar/default.nix
Normal file
22
legacyPackages/hass-components/yamaha-soundbar/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
yamaha-soundbar-src,
|
||||
buildHomeAssistantComponent,
|
||||
python3Packages,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) fromJSON readFile;
|
||||
|
||||
manifest = fromJSON (readFile "${yamaha-soundbar-src}/custom_components/yamaha_soundbar/manifest.json");
|
||||
in
|
||||
buildHomeAssistantComponent {
|
||||
owner = "osk2";
|
||||
|
||||
inherit (manifest) domain version;
|
||||
src = yamaha-soundbar-src;
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
async-upnp-client
|
||||
chardet
|
||||
validators
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue