Skip to content
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

Add device action support to the calendar integration #26983

Open
balloob opened this issue Sep 27, 2019 · 6 comments
Open

Add device action support to the calendar integration #26983

balloob opened this issue Sep 27, 2019 · 6 comments
Labels
Hacktoberfest help-wanted Wanna help? Jump in!

Comments

@balloob
Copy link
Member

balloob commented Sep 27, 2019

Add device action support to the calendar integration.

Device actions are part of Device Automations, a new concept that was recently launched to make automations more user friendly.

Device automations consist of three different parts: triggers, conditions and actions. This issue is about the action part.

To get started with this issue, you will need to set up a Home Assistant development environment. The easiest approach is to get started using a dev container.

Once you have a development environment set up, run the following and follow the instructions:

python3 -m script.scaffold device_action

(This issue is part of #26979)

@balloob balloob added Hacktoberfest help-wanted Wanna help? Jump in! labels Sep 27, 2019
@balloob balloob changed the title Add improved scene support to the calendar integration Add device action support to the calendar integration Sep 27, 2019
@shalini-s
Copy link

i'll give this a try!

@shalini-s
Copy link

hi, i'm getting this error when running python3 -m script.scaffold device_action:

$ python3 -m script.scaffold device_action

What is the domain?
> calendar
Traceback (most recent call last):
  File "/Users/ssreedhar/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/ssreedhar/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/ssreedhar/Documents/personal-projects/home-assistant/script/scaffold/__main__.py", line 87, in <module>
    sys.exit(main())
  File "/Users/ssreedhar/Documents/personal-projects/home-assistant/script/scaffold/__main__.py", line 50, in main
    info = gather_info.gather_info(args)
  File "/Users/ssreedhar/Documents/personal-projects/home-assistant/script/scaffold/gather_info.py", line 29, in gather_info
    return gather_existing_integration()
  File "/Users/ssreedhar/Documents/personal-projects/home-assistant/script/scaffold/gather_info.py", line 125, in gather_existing_integration
    lambda value: (COMPONENT_DIR / value).exists(),
  File "/Users/ssreedhar/Documents/personal-projects/home-assistant/script/scaffold/gather_info.py", line 173, in _gather_info
    if not validator(value):
  File "/Users/ssreedhar/Documents/personal-projects/home-assistant/script/scaffold/gather_info.py", line 121, in <lambda>
    lambda value: value == slugify(value),
  File "/Users/ssreedhar/Documents/personal-projects/home-assistant/homeassistant/util/__init__.py", line 49, in slugify
    return unicode_slug.slugify(text, separator="_")  # type: ignore
TypeError: slugify() got an unexpected keyword argument 'separator'

-> not sure if there's an error in the device action file? is there another place i can get the template for adding a device action?

@balloob
Copy link
Member Author

balloob commented Oct 23, 2019

That's weird. It means your slugify is not up to date. Can you run python3 install -e . to install the latest requirements of Home Assistant? The templates can be found here https://github.com/home-assistant/home-assistant/tree/dev/script/scaffold/templates/device_action

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added stale and removed stale labels Jan 26, 2021
@bubonicbob
Copy link
Contributor

bubonicbob commented Dec 31, 2023

I was looking at this issue as a way to introduce myself to HA code and followed the instructions. When I try out the scaffold by trying go to create a device action, I don't see where in the UI I am able to do this.

Am I seeing this correctly that the calendar integration only creates calendars as entities and does not create any device? That would mean that it isn't possible to add a device action to the calendar since there is no device at all? That is, in async_get_actions created by the scaffold, it is searching for a device_id but since there is no device, there will never be a device id.

only_entities

@joostlek
Copy link
Member

I'm also curious if this is still relevant as the calendar changed a lot in that last year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest help-wanted Wanna help? Jump in!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants