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

Dev #1

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configure here which dependency updates should be merged automatically.
# The recommended configuration is the following:
- match:
# Only merge patches for production dependencies
dependency_type: production
update_type: "semver:patch"
- match:
# Except for security fixes, here we allow minor patches
dependency_type: production
update_type: "security:minor"
- match:
# and development dependencies can have a minor update, too
dependency_type: development
update_type: "semver:minor"

# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see:
# https://dependabot.com/docs/config-file/#automerged_updates
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 5
assignees:
- TA2k
versioning-strategy: increase

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 5
assignees:
- TA2k
27 changes: 27 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Automatically merge Dependabot PRs when version comparison is within the range
# that is configured in .github/auto-merge.yml

name: Auto-Merge Dependabot PRs

on:
# WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action
# details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
pull_request_target:

jobs:
auto-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check if PR should be auto-merged
uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
# In order to use this, you need to go to https://github.com/settings/tokens and
# create a Personal Access Token with the permission "public_repo".
# Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN
github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
# By default, squash and merge, so Github chooses nice commit messages
command: squash and merge
65 changes: 38 additions & 27 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ name: Test and Release
on:
push:
branches:
- 'master'
- "main"
tags:
# normal versions
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
# pre-releases
- 'v[0-9]+.[0-9]+.[0-9]+-**'
- "v[0-9]+.[0-9]+.[0-9]+-**"
pull_request: {}

# Cancel previous PR/branch runs when a new commit is pushed
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
# Performs quick checks before the expensive test runs
check-and-lint:
Expand All @@ -35,7 +40,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [22.x, 20.x, 18.x]
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
Expand All @@ -45,38 +50,44 @@ jobs:
os: ${{ matrix.os }}
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
# install-command: 'npm install'
# TODO: To enable automatic npm releases, create a token on npmjs.org
# build: true

# TODO: To enable automatic npm releases, create a token on npmjs.org
# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options
# Then uncomment the following block:

# # Deploys the final package to NPM
# deploy:
# needs: [check-and-lint, adapter-tests]
#
# # Trigger this step only when a commit on any branch is tagged with a version number
# if: |
# contains(github.event.head_commit.message, '[skip ci]') == false &&
# github.event_name == 'push' &&
# startsWith(github.ref, 'refs/tags/v')
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: ioBroker/testing-action-deploy@v1
# with:
# node-version: '14.x'
# # Uncomment the following line if your adapter cannot be installed using 'npm ci'
# # install-command: 'npm install'
# npm-token: ${{ secrets.NPM_TOKEN }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# Deploys the final package to NPM
deploy:
needs: [check-and-lint, adapter-tests]

# Trigger this step only when a commit on any branch is tagged with a version number
if: |
contains(github.event.head_commit.message, '[skip ci]') == false &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/v')

runs-on: ubuntu-latest

# Write permissions are required to create Github releases
permissions:
contents: write

steps:
- uses: ioBroker/testing-action-deploy@v1
with:
node-version: '20.x'
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
# install-command: 'npm install'
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
#
# # When using Sentry for error reporting, Sentry can be informed about new releases
# # To enable create a API-Token in Sentry (User settings, API keys)
# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options
# # Then uncomment and customize the following block:
# sentry: true
# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
# sentry-project: "iobroker-homeconnect"
# sentry-version-prefix: "iobroker.homeconnect"
# sentry-project: "iobroker-nissan"
# sentry-version-prefix: "iobroker.nissan"
# # If your sentry project is linked to a GitHub repository, you can enable the following option
# # sentry-github-integration: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2030 TA2k <[email protected]>
Copyright (c) 2021-2024 TA2k <[email protected]>

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
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,32 @@

**Tests:** ![Test and Release](https://github.com/TA2k/ioBroker.nissan/workflows/Test%20and%20Release/badge.svg)

## nissan adapter for ioBroker
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.**\
For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)!\
Sentry reporting is used starting with js-controller 3.0.

Nissan Adapter
## Nissan adapter for ioBroker

With the Nissan adapter you can ask your nissan vehicle for the latest data, display the current battery and charging status, the current state of the climate control, start or stop climate control and and start charging remotely.

[Nissan Connect/App information](https://www.nissan.de/kunden/nissan-connect-apps.html)

## Forum

Feel free to follow the discussions in the german [iobroker forum](https://forum.iobroker.net/topic/46700/test-adapter-nissan-v-0-0-x)

## Changelog

<!--
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->

### **WORK IN PROGRESS**
- (bolliy) Dependency and configuration updates
- (bolliy) ConnectEV: Update status before reading cachedeStatus
- (bolliy) ConnectEV: change adminUI to json (js-controller >= 5.0)

### 0.1.2 (2024-05-31)

- Refresh Token fix
Expand All @@ -37,7 +58,7 @@ Nissan Adapter

MIT License

Copyright (c) 2021-2030 TA2k <[email protected]>
Copyright (c) 2021-2024 TA2k <[email protected]>

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
74 changes: 74 additions & 0 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"i18n": true,
"type": "tabs",
"items": {
"mainTab": {
"type": "panel",
"label": "Main settings",
"items": {
"user": {
"type": "text",
"label": "Nissan App Email",
"tooltip": "Nissan App Email",
"sm": 12,
"md": 8,
"lg": 2,
"newLine": true
},
"password": {
"type": "password",
"label": "password",
"tooltip": "",
"sm": 12,
"md": 8,
"lg": 2,
"newLine": true
},
"forceRefresh": {
"type": "checkbox",
"label": "Force Update to receive new data. This will drain 12V Battery. Please check 12V Battery",
"newLine": true,
"tooltip": "Force Update to receive new data. This will drain 12V Battery. Please check 12V Battery"
},
"interval": {
"type": "number",
"label": "Update interval (min)",
"min" : 5,
"max" : 120,
"default": 15,
"newLine": true,
"tooltip": "Update interval in minutes"
}
}
},
"tab2": {
"type": "panel",
"label": "vehicle before 2019",
"items": {
"nissanev": {
"type": "checkbox",
"label": "Old Nissan EV App for models before 2019",
"newLine": true,
"tooltip": "Old Nissan EV App for models before 2019"
},
"regionev": {
"type": "select",
"label": "Region",
"options":[
{"label": "Europe", "value":"NE"},
{"label": "USA", "value":"NNA"},
{"label": "Canada", "value":"NCI"},
{"label": "Australia", "value":"NMA"},
{"label": "Japan", "value":"NML"}
],
"default": "NE",
"sm":3,
"md":3,
"lg":3,
"xs":3,
"newLine": true
}
}
}
}
}
Loading