-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
home-assistant-custom-lovelace-modules.dirigera_platform: init at 2.6.4 #350542
home-assistant-custom-lovelace-modules.dirigera_platform: init at 2.6.4 #350542
Conversation
189a643
to
764714a
Compare
243e5d0
to
b8131b6
Compare
b8131b6
to
6a8e952
Compare
6a8e952
to
097750e
Compare
pkgs/servers/home-assistant/custom-components/dirigera_platform/package.nix
Outdated
Show resolved
Hide resolved
Turns out this does not build after all. Does it accidentally depend on pydantic>=2? dirigera> ______________________________ test_dict_to_scene ______________________________
dirigera>
dirigera> fake_client = <src.dirigera.hub.abstract_smart_home_hub.FakeDirigeraHub object at 0x7ffff529e120>
dirigera>
dirigera> def test_dict_to_scene(fake_client: FakeDirigeraHub) -> None:
dirigera> data1: Dict[str, Any] = {
dirigera> "id": "c9bbf831-6dcd-4442-8195-53eedb66a598",
dirigera> "info": {"name": "Tesscene", "icon": "scenes_clean_sparkles"},
dirigera> "type": "userScene",
dirigera> "triggers": [
dirigera> {
dirigera> "id": "f3ad4585-1a73-4e9c-9329-f926bedf509c",
dirigera> "type": "app",
dirigera> "triggeredAt": "2023-08-27T11:01:14.747Z",
dirigera> "disabled": False,
dirigera> }
dirigera> ],
dirigera> "actions": [
dirigera> {
dirigera> "id": "d0bf2ebf-3fcf-4e68-9810-0dc552e40388",
dirigera> "type": "deviceSet",
dirigera> "attributes": {"isOn": True, "lightLevel": 100},
dirigera> }
dirigera> ],
dirigera> "commands": [],
dirigera> "createdAt": "2023-08-27T10:28:48.096Z",
dirigera> "lastCompleted": "2023-08-27T11:01:14.767Z",
dirigera> "lastTriggered": "2023-08-27T11:01:14.767Z",
dirigera> "undoAllowedDuration": 30,
dirigera> "lastUndo": "2023-08-27T10:29:33.049Z",
dirigera> }
dirigera>
dirigera> scene1 = dict_to_scene(data1, fake_client)
dirigera> assert scene1.id == TEST_ID
dirigera> assert scene1.info.name == TEST_NAME
dirigera> assert scene1.info.icon.value == TEST_ICON
dirigera> assert scene1.last_completed == datetime.datetime.strptime(
dirigera> TEST_LAST_COMPLETED, "%Y-%m-%dT%H:%M:%S.%f%z"
dirigera> )
dirigera>
dirigera> data2: Dict[str, Any] = {
dirigera> "id": "00a0a00a-0aa0-0000-a000-00a0000a0a00",
dirigera> "info": {
dirigera> "name": "Night",
dirigera> "icon": "scenes_clean_sparkles"
dirigera> },
dirigera> "type": "userScene",
dirigera> "triggers": [
dirigera> {
dirigera> "id": "0000a0a0-0a00-000a-0a00-aaaaaa000000",
dirigera> "type": "app",
dirigera> "triggeredAt": "2024-04-23T21:34:51.619Z",
dirigera> "disabled": False
dirigera> },
dirigera> {
dirigera> "id": "a0000000-a000-0000-aaaa-0aaa000aa000",
dirigera> "type": "controller",
dirigera> "triggeredAt": "2024-04-20T05:49:20.178Z",
dirigera> "disabled": False,
dirigera> "trigger": {
dirigera> "days": [
dirigera> "Mon",
dirigera> "Tue",
dirigera> "Wed",
dirigera> "Thu",
dirigera> "Fri",
dirigera> "Sat",
dirigera> "Sun"
dirigera> ],
dirigera> "controllerType": "shortcutController",
dirigera> "clickPattern": "doublePress",
dirigera> "buttonIndex": 0,
dirigera> "deviceId": "0000aaaa-0000-0000-aa00-0a0aa0a000a0_2"
dirigera> }
dirigera> },
dirigera> {
dirigera> "id": "a0000000-a000-0000-aaaa-0aaa000aa000",
dirigera> "type": "sunriseSunset",
dirigera> "triggeredAt": "2024-04-24T17:49:00.989Z",
dirigera> "disabled": False,
dirigera> "trigger": {
dirigera> "days": [
dirigera> "Tue",
dirigera> "Wed",
dirigera> "Sun",
dirigera> "Mon",
dirigera> "Fri",
dirigera> "Sat",
dirigera> "Thu"
dirigera> ],
dirigera> "type": "sunset",
dirigera> "offset": 0
dirigera> },
dirigera> "nextTriggerAt": "2024-04-25T17:49:00.000Z"
dirigera> }
dirigera> ],
dirigera> "actions": [],
dirigera> "commands": [],
dirigera> "createdAt": "2023-11-06T22:10:14.806Z",
dirigera> "lastCompleted": "2024-04-24T05:13:24.352Z",
dirigera> "lastTriggered": "2024-04-24T05:13:24.352Z",
dirigera> "undoAllowedDuration": 30
dirigera> }
dirigera>
dirigera> > scene2 = dict_to_scene(data2, fake_client)
dirigera>
dirigera> tests/test_scenes.py:159:
dirigera> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dirigera> src/dirigera/devices/scene.py:148: in dict_to_scene
dirigera> return Scene(dirigeraClient=dirigera_client, **data)
dirigera> pydantic/main.py:339: in pydantic.main.BaseModel.__init__
dirigera> ???
dirigera> pydantic/main.py:1074: in pydantic.main.validate_model
dirigera> ???
dirigera> pydantic/fields.py:892: in pydantic.fields.ModelField.validate
dirigera> ???
dirigera> pydantic/fields.py:925: in pydantic.fields.ModelField._validate_sequence_like
dirigera> ???
dirigera> pydantic/fields.py:1091: in pydantic.fields.ModelField._validate_singleton
dirigera> ???
dirigera> pydantic/fields.py:881: in pydantic.fields.ModelField.validate
dirigera> ???
dirigera> pydantic/fields.py:1098: in pydantic.fields.ModelField._validate_singleton
dirigera> ???
dirigera> pydantic/fields.py:1154: in pydantic.fields.ModelField._apply_validators
dirigera> ???
dirigera> pydantic/class_validators.py:337: in pydantic.class_validators._generic_validator_basic.lambda13
dirigera> ???
dirigera> pydantic/main.py:711: in pydantic.main.BaseModel.validate
dirigera> ???
dirigera> pydantic/main.py:339: in pydantic.main.BaseModel.__init__
dirigera> ???
dirigera> pydantic/main.py:1074: in pydantic.main.validate_model
dirigera> ???
dirigera> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dirigera>
dirigera> > ???
dirigera> E pydantic.errors.ConfigError: field "trigger" not yet prepared so type is still a ForwardRef, you might need to call Trigger.update_forward_refs().
dirigera>
dirigera> pydantic/fields.py:857: ConfigError |
I've noticed the same, when I use this PR as overlay it works. But when I use the latest nixpkgs unstable it fails. I can't figure out why it doesn't work. I'm currently using it with this overlay with no issues. pkgs.python3Packages.callPackage (import "${
pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "097750eab077606b000f2c68d44225f488073cb8";
hash = "sha256-abRod/lwME8j9ADG44/FDD62ECN2qOkyqlgGp1FGalo=";
}
}/pkgs/servers/home-assistant/custom-components/dirigera_platform/package.nix") { } |
Does the system you have that overlay on have the pydantic update to 2.0? |
Yes, version
|
python3.pkgs.dirigera should set |
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.