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

BREAKING: Rework to aiohttp #221

Merged
merged 9 commits into from
Jan 14, 2023
Merged

BREAKING: Rework to aiohttp #221

merged 9 commits into from
Jan 14, 2023

Conversation

mib1185
Copy link
Owner

@mib1185 mib1185 commented Jan 12, 2023

This is considered as breaking change, because it now requests an aiohttp.ClientSession as session parameter within the SynologyDSM constructor, but verify_ssl is gone. If SSL verification should be disabled, configure the session accordingly (eq. aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False))

Example:

import asyncio
import aiohttp
from synology_dsm import SynologyDSM

async def main():
    print("Creating Valid API")
    async with aiohttp.ClientSession(
        connector=aiohttp.TCPConnector(verify_ssl=False)
    ) as session:
        api = SynologyDSM(session, "<IP/DNS>", "<port>", "<username>", "<password>")

        print("=== Information ===")
        await api.information.update()
        print("Model:           " + str(api.information.model))
        print("RAM:             " + str(api.information.ram) + " MB")
        print("Serial number:   " + str(api.information.serial))
        print("Temperature:     " + str(api.information.temperature) + " °C")
        print("Temp. warning:   " + str(api.information.temperature_warn))
        print("Uptime:          " + str(api.information.uptime))
        print("Full DSM version:" + str(api.information.version_string))
        print("--")

if __name__ == "__main__":
    asyncio.run(main())

@mib1185 mib1185 added breaking Breaking Change refactoring labels Jan 12, 2023
@mib1185 mib1185 marked this pull request as draft January 12, 2023 21:45
@mib1185 mib1185 changed the title Rework to aiohhtp Rework to aiohttp Jan 12, 2023
@mib1185 mib1185 changed the title Rework to aiohttp BREAKING: Rework to aiohttp Jan 12, 2023
@mib1185 mib1185 added this to the 2.0.0 milestone Jan 14, 2023
@mib1185 mib1185 force-pushed the aiohttp branch 2 times, most recently from bd7b687 to 7482ef5 Compare January 14, 2023 21:47
@mib1185 mib1185 marked this pull request as ready for review January 14, 2023 21:49
@mib1185 mib1185 merged commit e5bc103 into master Jan 14, 2023
@mib1185 mib1185 deleted the aiohttp branch January 14, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rework to aiohttp
1 participant