semvec/pypi-packages huggingface dataset:
ishelly 0.1.5.2
Control Shelly Home Automation Devices
Requires Python: <4.0,>=3.9

# ishelly
A shelly api wrapper library which uses pydantic models to use the api and as much of the shelly v2 features as possible. No shelly v1 support planned.

This library was built with the support of the LightningSpore open-source mushroom growing project: 
- https://lightningspore.com
- https://github.com/lightningspore/mushroom-monorepo

## Supported Devices

**Available Devices**
- Shelly Plug US
- Shelly 2PM
- Shelly Pro 4PM

## Install
```bash
pip install ishelly
```


## Usage
### Switch Control
```python
from ishelly.components.switch import *
from ishelly.components.schedule import *
from ishelly.components.shelly import *
from ishelly.client import ShellyPlug, Shelly2PM, ShellyPro4PM

# Initialize a Shelly Pro 4PM device object
plug_pro = ShellyPro4PM("http://192.168.1.125")

# Switch IDs for the high power outlets
switch_id_high_power_1 = 0
switch_id_high_power_2 = 3

# Step 1: Create a schedule to turn on the high power outlet 1 every 5 minutes
timespec_on = "0 */5 * * * *"
turn_on = SwitchSetRequest(
    id=1,
    params=SwitchSetParams(id=switch_id_high_power_1, toggle_after=90, on=True),
)

# Step 2: Add the scheduled task to the device
plug_pro.schedule.create(enable=True, timespec=timespec_on, calls=[turn_on])


# Step 3: Print the current schedules on the device
current_schedule = plug_pro.schedule.list()
for task in current_schedule.jobs:
    print(task)


# Step 4: Update an existing schedule (ID 4) to turn on the high power outlet 1 every 5 minutes
plug_pro.schedule.update(4, False, "0 */5 * * * *", calls=[turn_on])

# Step 5: Delete the schedule with ID 4
plug_pro.schedule.delete(4)
```

### Device Discovery
```python
from ishelly.client import ShellyDiscovery
discovery = ShellyDiscovery("10.0.0.0/24")
discovery.discover_devices()
```


## Example
The above example code, and more is located at: [examples](examples)
ci-test-toolkit 0.0.1
A framework for static analysis testing of CI configurations.
Requires Python: >=3.9

# CI Test
## Evan Kohilas

A framework for static analysis testing of CI configurations.

## Installation

Install using `pipx install ci-test-toolkit` to add `ci-test` to your PATH.

The tool can be run either via `ci-test` once installed or `python -m ci_test` from within the `src` folder.

## Example

`ci-test gitlab rule-snapshot <path_to_json>` will create a snapshot of your ci configuration, by listing all rulesets and the jobs that will run for each of them.

This snapshot can then be used to generate diffs of the linking between jobs and their rules.

## Input Generation

Currently the tool is setup to take input of the following form:

```json
[
    {
        "name": "job-name",
        "rules": [
            {
                "if": "$CI_PIPELINE_SOURCE == 'push'"
            },
            {
                "if": "$CI_PIPELINE_SOURCE == 'merge_request_event'",
                "changes": [
                    "**/*.py"
                ]
            },
        ]
    }
]
```

This is easiest made using [gitlab-ci-local](https://github.com/firecow/gitlab-ci-local)

With `node` installed, run `npx gitlab-ci-local --list-json > gitlab-ci-local.json` in a project directory with a `.gitlab-ci.yml` file.

Then, run `ci-test gitlab rule-snapshot gitlab-ci-local.json` to create a collated snapshot.

## TODO

- Remove the dependency on `gitlab-ci-local`
- Support GitHub configurations
- Add more testing commands
- Add better CLI
- Add linting/formatting
- Clean up for best practices

## Contibuting

Please see `CONTRIBUTING.md` for a head start.

Pull requests welcome!