Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
eyesoft committed Sep 7, 2022
1 parent d1ee9e3 commit eb9cf00
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 36 deletions.
63 changes: 63 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,66 @@ venv.bak/

# mypy
.mypy_cache/

# #############################
# JetBrain
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests
4 changes: 1 addition & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
MIT License

Copyright (c) 2018 eyesoft
Copyright (c) 2018 The Python Packaging Authority

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 32 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# home-assistant-custom-components
Custom components for Home Assistant (https://www.home-assistant.io/)
# Min Renovasjon

#### Min Renovasjon:
[![hacs_badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg)](https://github.com/hacs/integration)

Home Assistant integration of the norwegian Min Renovasjon app.

## Installation
Under HACS -> Integrations, add custom repository "https://github.com/eyesoft/home_assistant_min_renovasjon/" with Category "Integration". Select the newly added integration named "Min renovasjon" and install it.

## Configuration

To enable the use of Min Renovasjon in your installation, add the following to your configuration.yaml file:

```
min_renovasjon:
Expand All @@ -10,36 +18,37 @@ min_renovasjon:
street_code: "12345"
county_id: "1234"
date_format: "None"
```

sensor:
- platform: min_renovasjon
fraction_id:
- 1
- 2
- 3
- 19
```

**street_name:**\
The name of the street without house number, e.g. "Slottsplassen".
+ **street_name** _(string) (Requred)_: The name of the street without house number, e.g. "Slottsplassen".
+ **house_no** _(string) (Requred)_: The number of the house, e.g. "1".
+ **street_code** _(string) (Requred)_: Can be found with REST-API call.
+ **county_id** _(string) (Requred)_: Can be found with REST-API call.
+ **date_format** _(string) (Requred)_: Defaults to "%d/%m/%Y" if not specified. If set to "None" no formatting of the date is performed.

**house_no:** \
The number of the house, e.g. "1".
#### REST-API call to fetch street_code and county_id:

**street_code:** \
**county_id:** \
Can be found with this REST-API call.
```
https://ws.geonorge.no/adresser/v1/#/default/get_sok
https://ws.geonorge.no/adresser/v1/sok?sok=Min%20Gate%2012
```
"street_code" equals to "adressekode" and "county_id" equals to "kommunenummer".

**date_format:** \
Defaults to "%d/%m/%Y" if not specified. If set to "None" no formatting of the date is performed.
#### Fraction sensors

One sensor will be added for each fraction specified in your configuration.yaml file.

```
sensor:
- platform: min_renovasjon
fraction_id:
- 1
- 2
- 3
- 19
```

**fraction_id:**\
One or more fractions for which a sensor is to be set up. ID's might be different depending on county. Turn on debug logging in Home Asstistant to log the list of fractions
**fraction_id** _(int)(Required)_: One or more fractions for which a sensor is to be set up. ID's might be different depending on county. Turn on debug logging in Home Asstistant to log the list of fractions
(https://www.home-assistant.io/components/logger/).
```
1: Restavfall
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions custom_components/min_renovasjon/config_flow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from homeassistant import config_entries
from .const import DOMAIN


class ExampleConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Example config flow."""
12 changes: 12 additions & 0 deletions custom_components/min_renovasjon/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"domain": "min_renovasjon",
"name": "Min renovasjon",
"config_flow": false,
"documentation": "https://github.com/eyesoft/home_assistant_min_renovasjon",
"issue_tracker": "https://github.com/eyesoft/home_assistant_min_renovasjon/issues",
"codeowners": ["@eyesoft"],
"dependencies": [],
"requirements": [],
"version": "1.0.0",
"iot_class": "local_polling"
}
File renamed without changes.
5 changes: 5 additions & 0 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Min renovasjon",
"render_readme": true,
"country": ["NO"]
}
10 changes: 0 additions & 10 deletions min_renovasjon/manifest.json

This file was deleted.

0 comments on commit eb9cf00

Please sign in to comment.